TAA Tools
CLCTIMZOND      CALCULATE TIME ZONE DIFFERENCE         TAATINQ

The  Calculate Time  Zone  Difference  command  returns the  number  of
minutes  difference between  two time zones.   The  time zone  names as
used  by WRKTIMZON  may be  input or  special values such  as *PACIFIC.
Daylight  savings  time  is  considered.    An  optional  return  value
describes  the  difference in  HH:MM  format.   A  minus  value may  be
returned.

A typical series of commands would be:

              DCL         &DIFF *DEC LEN(5 0)
               .
              CLCTIMZOND  TOTIMZON(*PACIFIC) DIFFDEC(&DIFF)

The  FROMTIMZON parameter  defaults to *SYSVAL  which means  to use the
time zone described in the QTIMZON system value.

The &DIFF  variable would  contain the  difference  in minutes  between
the two time  zones.  If daylight  savings time (DST) is  in effect, it
is accounted for in the difference.

How CLCTIMZOND operates
-----------------------

The  RTVTIMZONT  command is  used  for  each time  zone  to  return the
offset  from  GMT  in   minutes.    Daylight   savings  time  is   also
considered.    The  offsets are  then  subtracted  and  the  result  is
divided by 60 to determine the number of hours.

CLCTIMZOND escape messages you can monitor for
----------------------------------------------

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

CLCTIMZOND Command parameters                         *CMD
-----------------------------

   FROMTIMZON    The  From time  zone to  be  used in  the calculation.
                 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

   TOTIMZON      The To  time zone to be  used in the calculation.   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

   DIFF          The  number  of  minutes difference  between  the  two
                 time zones.   A minus value may  be returned.  This is
                 an optional  return  variable  that if  used  must  be
                 specified as *DEC LEN(5 0).

   DIFFHRMIN     The difference  between the  two time  zones in  HH:MM
                 format.   A typical  value returned would  be '+01:00'
                 or  '-01:00'.   This  is  an optional  return variable
                 that if used must be specified as *CHAR LEN(6).

   RTNFROMNAM    The return name  of the From Time  Zone.  If the  From
                 Time  Zone is  operating under  daylight savings  time
                 (based  on  the  date/time  in  that  Time  Zone), the
                 daylight  savings   time   name  will   be   returned.
                 Otherwise,  the  normal  name  of  the  Time  Zone  is
                 returned.

                 This  is  an  optional return  variable  that  if used
                 must be specified as *CHAR LEN(50).

   RTNTONAM      The return name of the To  Time Zone.  If the To  Time
                 Zone is operating  under daylight savings  time (based
                 on  the date/time  in  that Time  Zone),  the daylight
                 savings  time name  will be returned.   Otherwise, the
                 normal name of the Time Zone is returned.

                 This  is an  optional  return  variable that  if  used
                 must be specified as *CHAR LEN(50).

   FROMDSTALW    Whether  the From  Time Zone  allows daylight  savings
                 time.   A *YES  or *NO will  be returned.   This is an
                 optional  return  variable  that   if  used  must   be
                 specified as *CHAR LEN(4).

   TODSTALW      Whether  the  To  Time Zone  allows  daylight  savings
                 time.   A *YES  or *NO will  be returned.   This is an
                 optional  return  variable  that   if  used  must   be
                 specified as *CHAR LEN(4).

   FROMDSTACT    Whether the  From Time  Zone is  actively on  daylight
                 savings  time.  A  *YES or *NO  will be returned.   If
                 the  time zone does not  support daylight savings time
                 or is not operating  under daylight savings time,  *NO
                 is returned.

                 This  is  an optional  return  variable  that if  used
                 must be specified as *CHAR LEN(4).

   TODSTACT      Whether  the  To  Time Zone  is  actively  on daylight
                 savings time.   A *YES or  *NO will be  returned.   If
                 the time zone  does not support daylight  savings time
                 or  is not operating under  daylight savings time, *NO
                 is returned.

                 This is  an  optional  return variable  that  if  used
                 must be specified as *CHAR LEN(4).

   FROMDATE      The date  at  the From  Time Zone  in CYYMMDD  format.
                 This  is  an optional  return  variable  that if  used
                 must be specified as *CHAR LEN(7).

   FROMTIME      The  time  at the  From  Time Zone  in  HHMMSS format.
                 This  is an  optional  return  variable that  if  used
                 must be specified as *CHAR LEN(6).

   TODATE        The  date  at the  To  Time  Zone  in CYYMMDD  format.
                 This  is  an  optional return  variable  that  if used
                 must be specified as *CHAR LEN(7).

   TOTIME        The time at the To  Time Zone in HHMMSS format.   This
                 is an  optional return variable  that if used  must be
                 specified as *CHAR LEN(6).

   FROMDAY       The day  of the week at  the From Time Zone.   A value
                 SUN, MON,  ...   SAT will  be returned.    This is  an
                 optional  return  variable   that  if  used   must  be
                 specified as *CHAR LEN(3).

   TODAY         The  day of the  week at  the To  Time Zone.   A value
                 SUN,  MON,  ...   SAT will  be returned.   This  is an
                 optional  return  variable   that  if  used  must   be
                 specified as *CHAR LEN(3).


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

Because  the  CLCTIMZOND command  returns  variables,  the command  may
only be used in a CL program.

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

The following TAA Tools must be on your system:

     DIVIDE          Divide
     RTVDSTDAT       Retrieve daylight savings time date
     RTVTIMZONT      Retrieve time zone time
     SNDESCINF       Send escape information

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

None, the tool is ready to use.

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

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

   CLCTIMZOND    *CMD                   TAATINQ       QATTCMD
   TAATINQC      *PGM       CLP         TAATINQC      QATTCL
					

Added to TAA Productivity tools January 15, 2010


Home Page Up to Top