HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
c
ctime(3C) ctime(3C)
int tm_mon; /* month of year - [0,11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0,6] */
int tm_yday; /* days since January 1 - [0,365] */
int tm_isdst; /* daylight savings time flag */
The value of tm_isdst is positive if a summer time zone adjustment such as Daylight Savings Time is in
effect, zero if not in effect, and negative if the information is not available.
The external variable timezone contains the difference, in seconds, between UTC and local standard
time (for example, in the U.S. Eastern time zone (EST), timezone is 56060). The external variable
daylight is non-zero only if a summer time zone adjustment is specified in the TZ environment variable.
The external variable tzname[2] contains the local standard and local summer time zone abbreviations
as specified by the TZ environment variable.
EXTERNAL INFLUENCES
Locale
The LC_CTYPE category determines the interpretation of the bytes within format as single and/or multi-
byte characters.
Environment Variables
The tzset() function uses the contents of TZ to set the values of the external variables timezone
,
daylight , and tzname. TZ also determines the time zone name substituted for the %Z and
%z
directives and the time zone adjustments performed by localtime() , mktime(), and ctime().Two
methods for specifying a time zone within
TZ are described in environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
For asctime_r() and ctime_r(), if the buffer is of insufficient length, a NULL is returned and
errno set to EINVAL.
asctime_r(), ctime_r(), gmtime_r(), and localtime_r(),
return a NULL and set
errno to EINVAL if NULL pointers are passed in as arguments.
A NULL is returned and errno is set to
ERANGE if the input to the following routines is not within the sup-
ported range: asctime(), asctime_r() , ctime(), ctime_r(), gmtime(), gmtime_r(),
localtime() , localtime_r().
APPLICATION USAGE
The return values for
asctime(), ctime(), gmtime(), and localtime() point to static data
whose contents is overwritten by each call. Thus, these routines are unsafe in multi-thread applications.
asctime_r() , ctime_r(), gmtime_r() , and localtime_r() are thread-safe. These interfaces
are not async-cancel-safe.
WARNINGS
Users of asctime_r() , ctime_r(), gmtime_r() , and localtime_r()
should also note that
these functions now conform to POSIX.1c. The old prototypes of these functions are supported for compati-
bility with existing DCE applicationsonly.
The range of
tm_sec([0,61])
extends to 61 to allow for the occasional one or two leap seconds. How-
ever, the ‘‘seconds since the Epoch’’ value returned by time(2) and passed as the timer argument does not
include accumulated leap seconds. The
tm structure generated by localtime() and gmtime() will
never reflect any leap seconds. Upon successful completion, mktime() forces the value of the tm_sec
component to the range [0,59].
AUTHOR
ctime() was developed by AT&T and HP.
SEE ALSO
time(2), getdate(3C), setlocale(3C), strftime(3C), tztab(4), environ(5), lang(5), langinfo(5).
Section 3106 3 HP-UX Release 11i: December 2000
___
___