January 31, 2007, 02:53 PM
moyer1dl@tod
How would I convert the system time from military to Normal Time (AM PM
Webfocus 7.1.1
Dan Moyer
January 31, 2007, 03:28 PM
Francis MarianiYou're talking about converting most-of-the-world time to mostly-north-america time?
I am assuming you want to do this in Dialogue Manager. It seems ridiculous, but this is the quickest way I could find:
-SET &ECHO=ALL;
-SET &H1 = EDIT(&TOD,'99');
-SET &H2 = IF &H1 GT 12 THEN &H1 - 12 ELSE &H1;
-SET &M = IF &H1 GT 12 THEN ' PM' ELSE 'AM';
-SET &TOD2 = &H2 | EDIT(&TOD,'$$$:99$:99') | &M;
-TYPE &TOD2
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 31, 2007, 03:58 PM
mgrackinFrancis,
Your technique is good but you lose the leading zero (0).
Just an FYI in case you want the leading zero for hours less than 10.
January 31, 2007, 04:09 PM
Jim MorrowBeware of the &TOD trap. UNLESS a SET DATETIME = NOW has been issued &TOD is the time the “thread” started, NOT the current time. This can be an issue if you are logging events, but for time stamps on a report the start up time is adequate.
I generally use
-SET &NOW=HHMMSS(‘A8’);
To get the current time.
January 31, 2007, 04:24 PM
Francis MarianiMickey, I realized that the leading zero dropped, but I thought that if someone wants to display the time in AM/PM, then they probably don't need the leading zero
Jim, I usually use HHMMSS, but using &TOD isn't a "trap" since my reports usually take 15 seconds or under to run
Cheers,
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server