November 01, 2006, 11:51 AM
Govind JujareA way to get Timestamp with Timezone from Dialog Manager ?
I am trying to print current Timestamp of the server in my report. Is there any way
to get the Timestamp with Timezone information included (For ex., PST) ? I prefer to
do it in Dialog Manager if possible. I tried &MDYY, &DMYY ... etc but they dont have
Timezone.
TIA,
November 01, 2006, 02:03 PM
PrarieThis will get you the day and time
DT/HMDYYIA = HGETC(8, 'HMDYYIA');
IBI has the following example to play with for
Time Zone.
DEFINE FILE CAR
NEW1/A8 WITH CAR=HHMMSS('A8');
NEW2/I2=EDIT(EDIT(NEW1,'99$$$$$$'));
NEW3/A6=EDIT(NEW1,'$$999999');
NEW4/I2=NEW2 - 1;
NEW5/A2=EDIT(NEW4);
NEW6/A8=NEW5||NEW3;
NEW7/I2=NEW2 - 2;
NEW8/A2=EDIT(NEW7);
NEW9/A8=NEW8||NEW3;
NEW10/I2=NEW2 - 3;
NEW11/A2=EDIT(NEW10);
NEW12/A8=NEW11||NEW3;
END
TABLE FILE CAR
HEADING
"EASTERN TIME IS:
"CENTRAL TIME IS: "MOUNTAIN TIME IS: "PACIFIC TIME IS: PRINT CAR NOPRINT
IF RECORDLIMIT EQ 1
END
| In Focus since 1993. WebFOCUS 7.7.03 Win 2003 |
November 01, 2006, 02:11 PM
Francis MarianiThat previous example unfortunately does not tell you what time zone the server is set to.
If your WebFOCUS server is on Windows, you may want to read this article:
http://www.informationbuilders.com/support/developers/timezone.html 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
November 01, 2006, 09:07 PM
Govind JujareThx for the replies. I am on Solaris. I decided to go with a INCLUDE file. I created a cron job to create this include file.
Main file:
-INCLUDE app/timezone.fex
Crontab entry:
00 01 * * * /apps/opt/webfocus/ibi/apps/proj01/crtz.sh >> /tmp/webfocus_cron.log 2>&1
Cron script (crtz.sh):
#!/usr/bin/ksh
export timezonestr=$(/usr/xpg4/bin/date '+%Z')
echo "-SET &vTimeZone='$timezonestr'" > /apps/opt/webfocus/ibi/WebFOCUS53/basedir/proj01/app/timezone.fex
Generated Include file (timezone.fex):
-SET &vTimeZone='PST'
WebFOCUS 5.3.3 MRE - Solaris - Sun Web Server - Weblogic