TAA Tools
RTVTIMZONT      RETRIEVE TIME ZONE TIME                TAATINR

The Retrieve  Time Zone  Time command  retrieves the  current date  and
time for  a specified time zone.   The day of week and  offset from GMT
may  also be retrieved.   Daylight savings time  (DST) is considered if
the time  zone supports  DST and the  current date/time  is within  the
DST start and end date/time.

A typical series of commands would be:

              DCL         &DATE *CHAR LEN(7)
              DCL         &TIME *CHAR LEN(6)
               .
              RTVTIMZONT  TIMZON(xxx) DATE(&DATE) TIME(&TIME)

The  TIMZON value  can  be a  specific  value such  as  QN0800PST or  a
special value such as *PACIFIC.

How RTVTIMZONT operates
-----------------------

The  date and  time from the  current system  is determined  as well as
the time zone of the  current system (using the QTIMZON system  value).
If the time  zone uses daylight savings time, the  RTVDSTDAT command is
used  to retrieve  the dates  that daylight savings  time is  in effect
along  with  the  daylight   savings  time  shift.     This  allows   a
determination of the time at GMT.

The time zone information  is then retrieved including the  offset from
GMT and  daylight savings time  information.  If  daylight savings time
is in effect, the offset time is shifted.

The  offset allows a calculation of the  date and time in the specified
time zone.

RTVTIMZOND escape messages you can monitor for
----------------------------------------------

None.  Escape messages from based on functions will be re-sent.

RTVTIMZONT Command parameters                         *CMD
-----------------------------

   TIMZON        The time zone to  retrieve the date and time for.   It
                 must  be one  of the  special values  or a  name  of a
                 time zone as seen with WRKTIMZON.

                 The  following  special values  exist  along  with the
                 time zone that will be used:

                   *SYSVAL      The QTIMZON system value
                   *GMT         Q0000GMT
                   *BRITISH     Q0000GMT2
                   *UTC         Q0000UTC
                   *ATLANTIC    QN0400AST2
                   *EASTERN     QN0500EST3
                   *CENTRAL     QN0600CST2
                   *MOUNTAIN    QN0700MST2
                   *PHOENIX     QN0800PST3
                   *PACIFIC     QN0800PST2
                   *ALASKA      QN0900AST2
                   *HAWAIIAN    QN1000HAS2
                   *NEWZEALAN   QP1200NZS3
                   *EAUSTRAL    QP1000AES3
                   *CAUSTRAL    QP0930ACS3
                   *WAUSTRAL    QP0800AWS3
                   *JAPAN       QP0900JST
                   *KOREA       QP0900KST
                   *BEIJING     QP0800BST
                   *MOSCOW      QP0300MSK
                   *INDIA       QP0530IST
                   *EEUROPE     QP0200EET3
                   *CEUROPE     QP0100CET4

   TIME          The current  time  in the  time  zone.   The  time  is
                 returned in  an HHMMSS  format.   This is an  optional
                 return  variable that  if  specified must  be declared
                 as *CHAR LEN(6).

   DATE          The current  date  in the  time  zone.   The  date  is
                 returned  in a  CYMD  format.    This is  an  optional
                 return  variable that  if specified  must  be declared
                 as *CHAR LEN(7).

   DAYOFWEEK     The  current day  of week  in the  time zone.   Values
                 such as SUN,  MON, ...   SAT will  be returned.   This
                 is  an  optional  return  variable that  if  specified
                 must be declared as *CHAR LEN(3).

   OFFSET        The  offset from  GMT in  minutes.   If the  Time Zone
                 uses  DST and  DST  is  in  effect,  the  offset  will
                 include  the DST  offset also.   This  is an  optional
                 return  variable that  if  specified must  be declared
                 as *DEC LEN(5 0).

   DSTALW        Whether DST is allowed  in the time zone.   A *YES  or
                 *NO will  be  returned.   This is  an optional  return
                 variable that  if specified must be  declared as *CHAR
                 LEN(4).

   DSTACTIVE     Whether  DST is active  for the current  date.  A *YES
                 or *NO will be  returned.  This is an  optional return
                 variable that  if specified must be  declared as *CHAR
                 LEN(4).

   NAME          The  name of  the time  zone.  If  DST is  not active,
                 the standard  name is  returned.   If  DST is  active,
                 the  DST  name  is  returned.   This  is  an  optional
                 return  variable that  if  specified must  be declared
                 as *CHAR LEN(50).


Restrictions
------------

Because RTVTIMZONT  uses  return variables,  the  command may  only  be
used in a CL program.

Prerequisites
-------------

The following TAA Tools must be on your system:

     ADDTIM          Add time
     RTVDAT          Retrieve date
     RTVDSTDAT       Retrieve DST date
     RTVTIMZOND      Retrieve time zone description
     SNDESCINF       Send escape information

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   RTVTIMZONT    *CMD                   TAATINR       QATTCMD
   TAATINRC      *PGM       CLP         TAATINRC      QATTCL
					

Added to TAA Productivity tools January 15, 2010


Home Page Up to Top