It's complicated. To the best of my grokking, z/OS maintains two totally independent time offsets. If the POSIX locale is not set, then any UNIX-ey type calls do not know the local time offset.
You're free to call MVS TIME. Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Phil Smith III Sent: Wednesday, August 14, 2019 3:10 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Local time in C on z/OS 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 ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN