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     [SHARING] GMT Offset

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SHARING] GMT Offset
 Login/Join
 
Virtuoso
posted
There is a way to calculate the GMT offset (difference between your time zone and Greenwich Mean Time) in ReportCaster. Essentially it involves extracting the time component of the NEXTRUNTIME from an active job schedule (which is based on GMT), and comparing it to the current local time at the time the job runs. This only works correctly when run in ReportCaster. The job where the calculation is performed must be an active job so that NEXTRUNTIME has a value. The date portions of NEXTRUNTIME and the local time zone are igonored (we assume ReportCaster is running the job on the correct date), so this approach should work with any active job schedule, regardless the run interval. If the job requiring the GMT offset is running in ReportCaster, then the code below can simply be added to the program logic, or -INCLUDEd. If tasks outside of ReportCaster need the GMT offset, the code below could be scheduled to run daily in ReportCaster and write the GMT offset to a file for reference by other programs.

-*******************************************************************************************************
-* EXPLANATION OF DEFINES BELOW:
-* GET CURRENT LOCAL DATE-TIME.
-* EXTRACT THE CURRENT LOCAL TIME IN MILLISECONDS.
-* THE BASE DATE FOR REPORTCASTER IS 1/1/1970.
-* CONVERT THE RC BASE DATE TO A DATE-TIME VALUE (TIME DEFAULT=12 AM).
-* CONVERT NEXTRUNTIME, WHICH IS THE NUMBER OF MILLISECONDS TO THE NEXT GMT RUN DATE-TIME, TO NUMERIC.
-* ADD THE NUMBER OF NEXTRUNTIME MILLISECONDS TO BASE DATE TO ARRIVE AT THE NEXT GMT RUN DATE-TIME.
-* EXTRACT THE NEXT GMT RUN TIME IN MILLISECONDS.
-* CALCULATE GMT OFFSET = MILLISECOND DIFFERENCE / 3600000, TO GET HOURS.
-*******************************************************************************************************
DEFINE FILE BOTSCHED
 NOW_DTTM/HYYMDIA WITH SCHEDULEID = HGETC(8,'HYYMDIA');
 NOW_TIME/D20c       = HTIME(8,NOW_DTTM,'D20c');
 RC_BASEDATE/YYMD WITH SCHEDULEID = '19700101';
 RC_BASEDTTM/HYYMDIA = HDTTM(RC_BASEDATE,8,'HYYMDIA');
 NRT_NUMERIC/D32c    = EDIT(NEXTRUNTIME);
 NRT_DTTM/HYYMDIA    = HADD(RC_BASEDTTM,'MILLISECOND',NRT_NUMERIC,8,'HYYMDIA');
 NRT_TIME/D20c       = HTIME(8,NRT_DTTM,'D20c');
 GMT_OFFSET/D12c     = (NRT_TIME - NOW_TIME) / 3600000 ;
END
-*
TABLEF FILE BOTSCHED
 PRINT GMT_OFFSET
 WHERE (SCHEDULEID EQ '&DSTSCHEDID');
 ON TABLE SAVE AS GMTOFFSET
END
-*
-RUN
-READ GMTOFFSET &GMT_OFFSET.12.
-RUN

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report 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     [SHARING] GMT Offset

Copyright © 1996-2020 Information Builders