ctime.3c (2010 09)

c
ctime(3C) ctime(3C)
gmtime() Convert directly to Coordinated Universal Time (UTC), the time standard used by the
HP-UX operating system. gmtime() returns a pointer to the
tm structure
described below.
The minimum date supported by
gmtime() in both 32-bit and 64-bit HP-UX is Fri-
day December 13 20:45:52 UTC 1901. The maximum dates supported by
gmtime()
are Tuesday January 19 03:14:07 UTC 2038 and Friday December 31 23:59:59 UTC
9999 in 32-bit HP-UX and 64-bit HP-UX, respectively.
In 64-bit HP-UX,
gmtime() returns NULL and sets errno to [ERANGE] if timer is
less than the number of seconds that corresponds to the minimum date supported
(i.e., INT_MIN, as defined in
limits.h), or exceeds the number of seconds that
corresponds to the maximum date supported.
gmtime_r() is identical to gmtime(), except that
gmtime_r() stores the result in the tm
struct pointed to by result and returns
result upon success.
localtime() Correct for the time zone and any summer time zone adjustments (such as Daylight
Savings Time in the USA), according to the contents of the
TZ environment variable
(see Environment Variables below).
localtime() returns a pointer to the tm
structure described below.
The minimum date supported by
localtime() in both 32-bit and 64-bit HP-UX is
Friday December 13 20:45:52 UTC 1901. The maximum dates supported by
local-
time()
are Tuesday January 19 03:14:07 UTC 2038 and Friday December 31
23:59:59 UTC 9999 in 32-bit HP-UX and 64-bit HP-UX, respectively.
In 64-bit HP-UX,
localtime() returns NULL and sets errno to [ERANGE] if timer
is less than the number of seconds that corresponds to the minimum date supported
(i.e., INT_MIN, as defined in limits.h), or exceeds the number of seconds that
corresponds to the maximum date supported.
localtime_r() is identical to
localtime(), except that localtime_r() stores the result in the
tm struct pointed to by result and returns result upon success.
mktime() Convert the broken-down time (expressed as local time) in the structure pointed to by
timeptr into a calendar time value with the same encoding as that of the values
returned by time(). The original values of the tm_wday and tm_yday com-
ponents of the structure are ignored, and the original values of the other components
are not restricted to the ranges indicated below.
A positive or zero value for
tm_isdst causes mktime() to initially presume that
Daylight Saving Time respectively is or is not in effect for the specified time. A nega-
tive value for tm_isdst causes mktime() to attempt to determine whether Day-
light Saving Time is in effect for the specified time.
Upon successful completion, all the components are set to represent the specified
calendar time, but with their values forced to the ranges indicated below. The final
value of
tm_mday is not set until tm_mon and tm_year are determined.
mktime() returns the specified calendar time encoded as a value of type time_t.
The minimum date supported by
mktime() in both 32-bit and 64-bit HP-UX is Fri-
day December 13 20:45:52 UTC 1901. The maximum dates supported by mktime()
are Tuesday January 19 03:14:07 UTC 2038 and Friday December 31 23:59:59 UTC
9999 in 32-bit HP-UX and 64-bit HP-UX, respectively.
For 32-bit
mktime(), if the calendar time cannot be represented, the function
returns the value (time_t) 1 and sets errno to [ERANGE]. Note the value
(time_t) 1 also corresponds to the time 23:59:59 on Dec 31, 1969 (plus or minus
time zone and Daylight Saving Time adjustments). Thus it is necessary to check both
the return value and errno to reliably detect an error condition.
The behavior of 64-bit
mktime() beyond the supported ranges is undefined.
tzset() Sets the values of the external variables timezone , daylight , and tzname according to
the contents of the TZ environment variable (independent of any time value). The
functions localtime(), mktime(), ctime(), asctime(), and strftime()
(see strftime (3C)) call tzset() and use the values returned in the external vari-
ables described below for their operations. tzset() can also be called directly by
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010