Adagio
7 years agoFrequent Contributor
convert 24 hr clock time to 12 hr clock time
Hello,
I've to convert the time stamps based on 24hr clock ro 12 hr clock.
For example - 1/4/2018 13:09:52 needs to be converted to 1/4/2018 1:09:52.
Is there any built-in feature that I can utilize to do this conversion?
any help would be appreciated!
Thank you
abhi
The time stamps, are they strings? If they are strings, you can convert them to date time using aqConvert.StrToDateTime. Then you can use aqConvert.DateTimeToFormatStr to format the string to the desired format.
All aqConvert methods are explained at https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqconvert/index.html
As tristaanogre said, you can those methods to generate whatever format you want,
I'm just giving an example for your requirement,
var dateValue = aqConvert.StrToDate("1/4/2018 13:09:52"); Log.Message(aqConvert.DateTimeTpFormatStr(dateValue,%d-%b-%Y %I:%M:%S %p)); 01-Apr-2018 1:09:52 will get printed