Focal Point Banner


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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] TimeZone in Default dates

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] TimeZone in Default dates
 Login/Join
 
Member
posted
I have been working on a default date range. Currently it changes the dates at midnight and I need it to change at 11am EST. Can I change this code to reflect this change?

  
-DEFAULT &START_NUM = -30;
-DEFAULT &END_NUM = -1;
-DEFAULT &DATE_UNIT = 'D';
-SET &TODT=DATECVT(DATEADD(DATECVT(&MDYY,'I8MDYY','MDYY'),'&DATE_UNIT.EVAL',&END_NUM),'MDYY','I8MDYY');
-SET &FROMDT=DATECVT(DATEADD(DATECVT(&TODT,'I8MDYY','MDYY'),'&DATE_UNIT.EVAL',&START_NUM),'MDYY','I8MDYY');

-SET &FROMDT = IF &FROMDT.LENGTH NE 8 THEN '0&FROMDT.EVAL' ELSE &FROMDT;
-SET &TODT = IF &TODT.LENGTH NE 8 THEN '0&TODT.EVAL' ELSE &TODT;

-IF &WFV_LANG EQ en THEN GOTO L_EN;
-* Set Date for other contries in DMYY format

-SET &FROMDT = EDIT(&FROMDT,'$$99')||'/'||EDIT(&FROMDT,'99')||'/'||EDIT(&FROMDT,'$$$$9999');
-SET &TODT = EDIT(&TODT,'$$99')||'/'||EDIT(&TODT,'99')||'/'||EDIT(&TODT,'$$$$9999');

-GOTO L_ENDDATE
-* Set Date for english in MDYY format
-L_EN
-SET &FROMDT = EDIT(&FROMDT,'99/99/9999');
-SET &TODT = EDIT(&TODT,'99/99/9999');
-L_ENDDATE
-TYPE &FROMDT - &TODT

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.8
Windows XP
HTML
 
Posts: 6 | Registered: April 22, 2010Report This Post
Virtuoso
posted Hide Post
You could experiment with DM variable &TOD or function HHMMSS such that if the time is later than 11:00:00, use (&MDDYY - 1), else use &MDYY.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Master
posted Hide Post
Either
-SET &TM=HHMMSS('A8');
or &TOD will give you the system time.
(&TOD is usually the time the job starts). Check the results for less than '11.00.00' and subtract 1 day from the dates.

-SET &CURRDT=IF &TM LT '11.00.00' THEN AYMD(&YYMD,-1,'I8YYMD') ELSE &YYMD;


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
If you run the next statement, you'll see that it gives you the current time + 1 hour. If you take out the date part from the variable &NOW, then you'll have your date change at 11 pm in stead of at midnight.
-SET &NOW = HCNVRT(HADD(HGETC(8,'HYYMDS'), 'HOUR', 1, 8, 'HYYMDS'), '(HYYMDS)', 30, 'A30');
-TYPE &NOW  

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Member
posted Hide Post
This works ok, but it's based on system time.

  
-SET &TM=HHMMSS('A8');

-SET &START_NUM=IF &TM LT '11.00.00' THEN '-31' ELSE '-30';
-SET &END_NUM=IF &TM LT '11.00.00' THEN '-2' ELSE '-1';



I was hoping to implement http://www.informationbuilders...lopers/timezone.html

I have this working so far.

 
-* File timezone.fex

-*-- System call to write the registry value to a file
! REG QUERY HKLM\SYSTEM\CURRENTCONTROLSET\CONTROL\TIMEZONEINFORMATION /V ACTIVETIMEBIAS > TZ.TXT

-*-- Filedef the generated file so that it can be read by WebFOCUS
FILEDEF TZ DISK ./TZ.TXT (LRECL 80 RECFM V
-RUN

-*-- Loop through the file to find the line that contains the required value
-LOOP
-READ TZ &LINE.A80.

-IF &LINE OMITS 'ACTIVETIMEBIAS' GOTO LOOP;
-RUN

-*-- extract the value using GETTOK
-SET &HEX=GETTOK(&LINE, 128, -1, 'x', 10, 'A10');

-*-- Decode the hex value returned by Windows to a decimal value
-SET &OFFSET =DECODE &HEX(
- 'fffffd30' '-720', 'fffffd6c' '-660', 'fffffda8' '-600', 'fffffde4' '-540',
- 'fffffe20' '-480', 'fffffe5c' '-420', 'fffffe98' '-360', 'fffffed4' '-300',
- 'ffffff10' '-240', 'ffffff2e' '-210', 'ffffff4c' '-180', 'ffffff88' '-120',
- 'ffffffc4'  '-60', '0'           '0', '3c'         '60', '78'        '120',
- 'b4'        '180', 'd2'        '210', 'f0'        '240', '10e'       '270',
- '12c'       '300', '14a'       '330', '159'       '345', '168'       '360',
- '186'       '390', '1a4'       '420', '1e0'       '480', '21c'       '540',
- '23a'       '570', '258'       '600', '294'       '660', '2d0'       '720',
- '30c'       '780'  ELSE '0');

-*-- Set up the number of hours to offset GMT time
-SET &&OFFSETHOURS = -(&OFFSET / 60);
-*-- Set up the number of minutes to offset GMT time
-SET &&OFFSETMINS  = -(&OFFSET);
 


WebFOCUS 7.6.8
Windows XP
HTML
 
Posts: 6 | Registered: April 22, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] TimeZone in Default dates

Copyright © 1996-2020 Information Builders