Focal Point
@tod

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3851086012

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


IBM Main Frame: MVS, FIX, VSAM

Windows SQL

WF 7.7
January 31, 2007, 03:28 PM
Francis Mariani
You'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
mgrackin
Francis,

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.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
January 31, 2007, 04:09 PM
Jim Morrow
Beware 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.


Jim Morrow
Web Focus 7.6.10 under Windows 2003
MVS 7.3.3



January 31, 2007, 04:24 PM
Francis Mariani
Mickey, 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 Smiler

Jim, I usually use HHMMSS, but using &TOD isn't a "trap" since my reports usually take 15 seconds or under to run Smiler

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