On Thu, 5 Sep 2013 16:13:07 -0700, Charles Mills wrote:
>
>2. Does setting timezone_name to EST or PDT make sense? Is EST or PDT an
>appropriate sort of setting?
>
To be POSIXly correct, you should follow:

Title: z/OS V1R13.0 XL C/C++ Programming Guide
Document Number: SC09-4765-12

 8.4.1 Using the TZ or _TZ environment variable to specify time zone
...
The TZ or _TZ environment variable has the following format.

    ________________________________________________________________________ 
   |                                                                        |
   |   TZ=standardHH[:MM[:SS]]                                              |
   |   [daylight[HH[:MM[:SS:]]]                                             |
   |   [,startdate[/starttime],enddate[/endtime]]]                          |
   |                                                                        |
   |________________________________________________________________________|

Neither that nor POSIX gives an example in the glory of its full complexity.
But in, e.g.:

    http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
    EST+5EDT,M4.1.0/2,M10.5.0/2

But I prefer (and shall surely be castigated here for) the convention prevalent
on most open systems (opener, that is, than z/OS):

    510 $ TZ=Australia/Canberra date; TZ=America/New_York date
    Fri Sep  6 13:51:17 EST 2013
    Thu Sep  5 23:51:17 EDT 2013

(Yes, note the E?T ambiguity.)

This even gives correct results for 2006 and earlier, which the POSIX
convention, adhered to by z/OS can not.  (It's compatible; the POSIX
format is still supported.)

>3. Is setenv() the most reasonable way to set timezone_name?
>
I believe I've used tzset():

int showtz ( char *tz ) {
    putenv( tz );
    if ( 0 ) tzset();  /* Not needed for strftime.  */
    return( showit( tz ) ); }

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to