The Question is:
The C langage localtime returns a time that is one hour off.
$ cc/noopt/deb t
$ lin t/deb
$ run t
OpenVMS Alpha Debug64 Version V7.2-019
~stepped through code
DBG> type 1940:1946
1942: tm_t *z; time_t t;
1943: t = time(0);
DBG> exam @z
tm_hour: 14 <== Note that time is one hour off
$ show time
DEC C V6.0-001 on OpenVMS Alpha V7.2
$ sh log/sys *time*
"SYS$LOCALTIME" = "SYS$SYSROOT:[SYS$ZONEINFO.SYSTEM.US]PACIFIC."
"SYS$TIMEZONE_DAYLIGHT_SAVING" = "1"
"SYS$TIMEZONE_DIFFERENTIAL" = "-25200"
"SYS$TIMEZONE_NAME" = "PDT"
"SYS$TIMEZONE_RULE" = "PST8PDT7,M4.1.0/2,M10.5.0/2"
"TCPIP$BIND_TIMEOUT" = "...."
"TCPIP$CFS_ATTR_CACHE_TIMEOUT" = "5"
The Answer is :
The setting of the tm_isdst field clearly indicates that the system
had determined that daylight savings time (DST) is not in effect, and
thus that the current time is Standard Time.
Now, as to why this has occured...
The localtime() function was given the correct UTC. The localtime()
function itself knows exactly nothing about the OpenVMS UTC system
services, the timezone differential factor (TDF), and other OpenVMS
system-specific creatures. What it does know about are the rules in
the timezone file. According to the timezone rules, the month of
December is Standard Time. While mapping a given UTC time to the
local time, the localtime() function applied the offset for Standard
Time and returned the correct Standard Time corresponding to the
correct UTC time returned by the time() function. Of course, this
correct Standard Time was one hour off from the phony DST time on