I'm looking at my C++ code. I wrote it, but I wrote it before I understood as much (?) as I do now, and before GSK surprised me and made me run POSIX(ON).
Background: the code runs on many different systems and customers set their machines up the way they set them up. The code uses localtime() and also occasionally strftime() with various format specifiers. I think I have a pretty good handle on the function of the TZ environment variable. But I see code that sets the environment variable timezone_name to a string such as EST or PDT. I don't know exactly why the code is there. I am reading the notes following, for example, localtime() but I don't know what exactly to make of them. 1. I assume I do need to set timezone_name or localtime() may not function correctly, and certainly not strftime %Z. Is that assumption correct? 2. Does setting timezone_name to EST or PDT make sense? Is EST or PDT an appropriate sort of setting? 3. Is setenv() the most reasonable way to set timezone_name? I can see that my parsing of strings such as "EST5EDT" into a timezone_name is inadequate, but before I re-write it I wanted to see if it was really necessary. Is there a better way to do things? Is there a library function that will parse TZ into among other things timezone_name, so I don't have to re-invent the wheel, possibly badly? Thanks, Charles ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
