As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at firstname.lastname@example.org and provide your corporate email address, company, and name.
Write yourself a little function that you can call from an "include" whenever you want to convert the time. I wrote this one that I use all the time:
DEFINE FUNCTION TIMEAMPM(TIMEIN/A6)
-* get the time in a left-padded 6 character string and return character string in
-* the form hh:mm am/pm. e.g. Pass '000630' and return '6:30 am'.
-* TIMEIN = string field to parse in '00HHMM' military time format.
-* get the hour and minutes as a string
HRTEMP/A2 = EDIT(TIMEIN, '$$99');
MINUTE/A2 = EDIT(TIMEIN, '$$$$99');
-* convert the hour into an integer so you can do some math and comparisons
HRTEMP1/I2 = ATODBL(HRTEMP, '02', 'I2');
-* if hr > 12 then (hr - 1) else hr
HOUR/A2 = IF HRTEMP1 GT 12 THEN FPRINT(HRTEMP1 - 12, 'I2', 'A2') ELSE HRTEMP;
-* if hr > 11 then 'pm' else 'am'
AMPM/A2 = IF HRTEMP1 GT 11 THEN 'PM' ELSE 'AM';
-* formats into hh:mm pm/am. Note this is NOT in military time
TIMEAMPM/A8 = HOUR | ':' | MINUTE | ' ' | AMPM;
You can tweak it for a 4 character input variable and adding a leading zero to the output if you desire.