Here is some code that was provided to XMITIP by Leland Lucius that will get 
you the time zone while in rexx:

  /* rexx */
  say timezone()
  exit

  /*
  * =============================================================
  * Function:      Timezone    : Calculates the offset from GMT
  * Arguments:     (none)      : nothing is required
  * Return:        offset      : offset in (-)HHMM format
  * Exposed vars:  (none)      : nothing is exposed
  *
  * Note:  Uses the CVTLDTO field in one of the CVT extensions.
  *        It looks like this field was added sometime in 1991,
  *        so this routine will not work on any OS version older
  *        than that.
  * =============================================================
  */
Timezone:
  PROCEDURE

  /* ===========================================================
  * We're gonna have a big number
  */
  NUMERIC DIGITS 21

  /* ===========================================================
  * Get current CVTLDTO
  *   (Local Date Time Offset in STCK format))
  */
  cvt     = C2d( Storage( D2x( 16 ), 4 ) )
  cvttz   = C2d( Storage( D2x( cvt + 304 ), 4 ) )
  cvtext2 = C2d( Storage( D2x( cvt + 328 ), 4 ) )
  cvtldto = C2d( Storage( D2x( cvtext2 + 56 ), 8 ), 8 )

  /* ===========================================================
  * Calc the current offset in hours and minutes
  *    (work with absolute)
  */
  absldto = Abs( cvtldto )
  hours   = absldto % x2d("D693A400000" )
  minutes = ( absldto % x2d("3938700000") ) // 60

  /* ===========================================================
  * Correction to Round to nearest hour
  */
  If minutes <> "00"  Then Do
    If minutes > 30 Then
    hours = hours + 1
    /* minutes = 00 */
  End

  /* ===========================================================
  * Format to ANSI standard X3.51-1975
  */
  zone    = Right( hours, 2, "0" )Right( minutes, 2, "0" )
  IF cvtldto < 0 THEN DO
    zone      = "-"zone
  END
  ELSE DO
    zone = "+"zone
  END

  /* ===========================================================
  * Reset
  */
  NUMERIC DIGITS

  RETURN zone


Lionel B. Dyck <sdg><
Website: https://www.lbdsoftware.com

"Worry more about your character than your reputation.  Character is what you 
are, reputation merely what others think you are." - John Wooden

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Steve Smith
Sent: Sunday, May 17, 2020 3:08 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How determine local time zone *name* in Rexx?

It's not so basic.  AFAIK, z/OS doesn't keep track of the local timezone name, 
other than the Unix TZ environment variable, which of course is arbitrarily set 
by whoever sets it.  But that's pretty much the nature of timezone names, which 
are not unique, consistent, or properly understood.

If you really wanted to go down the rabbit hole, you'd have to incorporate the 
logic of https://www.timeanddate.com/ as well as know your latitude.  A bit 
more than a table look up.

sas


On Sun, May 17, 2020 at 3:21 PM Charles Mills <charl...@mcn.org> wrote:

> The heck with it! I wanted it for the "Date:" line in an outgoing 
> e-mail but it appears that SMTP provides a sent timestamp if I don't, 
> so the heck with it!
>
> Thanks all for your efforts. Why should something so basic be so hard?
>
> Charles
>
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to