From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- man/man3/ctime.html | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 man/man3/ctime.html (limited to 'man/man3/ctime.html') diff --git a/man/man3/ctime.html b/man/man3/ctime.html new file mode 100644 index 00000000..4c162391 --- /dev/null +++ b/man/man3/ctime.html @@ -0,0 +1,150 @@ + +ctime(3) - Plan 9 from User Space + + + + +
+
+
CTIME(3)CTIME(3) +
+
+

NAME
+ +
+ + ctime, localtime, gmtime, asctime, tm2sec, timezone – convert date + and time
+ +
+

SYNOPSIS
+ +
+ + #include <u.h>
+ #include <libc.h> +
+
+ char* ctime(long clock) +
+
+ Tm*     localtime(long clock) +
+
+ Tm*     gmtime(long clock) +
+
+ char* asctime(Tm *tm) +
+
+ long    tm2sec(Tm *tm)
+
+
+

DESCRIPTION
+ +
+ + Ctime converts a time clock such as returned by time(3) into ASCII + (sic) and returns a pointer to a 30-byte string in the following + form. All the fields have constant width. +
+ + +
+ + +
+ + Wed Aug    5 01:07:47 EST 1973\n\0 +
+
+ +
+ +
+ Localtime and gmtime return pointers to structures containing + the broken-down time. Localtime corrects for the time zone and + possible daylight savings time; gmtime converts directly to GMT. + Asctime converts a broken-down time to ASCII and returns a pointer + to a 30-byte string.
+ +
+ + typedef
+ struct {
+ +
+ + int    sec;          /* seconds (range 0..59) */
+ int    min;          /* minutes (0..59) */
+ int    hour;         /* hours (0..23) */
+ int    mday;         /* day of the month (1..31) */
+ int    mon;          /* month of the year (0..11) */
+ int    year;         /* year A.D. – 1900 */
+ int    wday;         /* day of week (0..6, Sunday = 0) */
+ int    yday;         /* day of year (0..365) */
+ char zone[4];      /* time zone name */
+ int    tzoff;        /* time zone delta from GMT */
+ +
+ } Tm;
+ +
+
+ +
+ Tm2sec converts a broken-down time to seconds since the start + of the epoch. It ignores wday, and assumes the local time zone + if zone is not GMT.
+ +
+

SOURCE
+ +
+ + /usr/local/plan9/src/lib9/date.c
+ /usr/local/plan9/src/lib9/ctime.c
+
+
+

SEE ALSO
+ +
+ + date(1), time(3)
+ +
+

BUGS
+ +
+ + The return values point to static data whose content is overwritten + by each call. +
+ + Daylight Savings Time is “normal” in the Southern hemisphere. + +
+ + These routines are not equipped to handle non-ASCII text, and + are provincial anyway. +
+ + To avoid name conflicts with the underlying system, ctime, localtime, + gmtime, asctime, and tm2sec are preprocessor macros defined as + p9ctime, p9localtime, p9gmtime, p9asctime, and p9tm2sec; see intro(3).
+ +
+ +

+
+
+ + +
+
+
+Space Glenda +
+
+ + -- cgit v1.2.3