I have a C POSIX application that writes timestamps on its output. It's always 
produced a GMT timestamp (pardon me, UTC), and that's sort of fugly, so I 
thought maybe I could fix it.

 

Looking at the code, it's using ctime(). Ok, hey, localtime() should be 
gooderT! Nope, per IBM doc:

*  The ctime(), localtime(), and mktime() functions now return Coordinated 
Universal Time (UTC) unless customized locale information is made available, 
which includes setting the timezone_name variable. 

*  In POSIX you can supply the necessary information by using environment 
variables.

 

Gee, thanks (and what does "now" mean in that first sentence? As opposed to 
tomorrow?? Last week???).

 

I'm not in a position to set environment variables for this. I know the 
hardware is set to UTC, but there's a system timezone offset at some level. Is 
there no simple way to just say "Gimme the same time as the operator's console 
would show"? Searching sure hasn't found one, hoping someone knows better!


----------------------------------------------------------------------
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