| @@ -1,40 +1,40 @@ | | | @@ -1,40 +1,40 @@ |
1 | .\" $NetBSD: ctime.3,v 1.37 2010/12/17 01:30:50 wiz Exp $ | | 1 | .\" $NetBSD: ctime.3,v 1.38 2011/01/24 19:37:35 njoly Exp $ |
2 | .Dd December 14, 2010 | | 2 | .Dd December 14, 2010 |
3 | .Dt CTIME 3 | | 3 | .Dt CTIME 3 |
4 | .Os | | 4 | .Os |
5 | .Sh NAME | | 5 | .Sh NAME |
6 | .Nm asctime , | | 6 | .Nm asctime , |
7 | .Nm asctime_r , | | 7 | .Nm asctime_r , |
8 | .Nm ctime , | | 8 | .Nm ctime , |
9 | .Nm ctime_r , | | 9 | .Nm ctime_r , |
10 | .Nm ctime_rz , | | 10 | .Nm ctime_rz , |
11 | .Nm difftime , | | 11 | .Nm difftime , |
12 | .Nm gmtime , | | 12 | .Nm gmtime , |
13 | .Nm gmtime_r , | | 13 | .Nm gmtime_r , |
14 | .Nm localtime , | | 14 | .Nm localtime , |
15 | .Nm localtime_r , | | 15 | .Nm localtime_r , |
16 | .Nm localtime_rz , | | 16 | .Nm localtime_rz , |
17 | .Nm mktime , | | 17 | .Nm mktime , |
18 | .Nm mktime_z , | | 18 | .Nm mktime_z , |
19 | .Nm tzalloc , | | 19 | .Nm tzalloc , |
20 | .Nm tzgetname , | | 20 | .Nm tzgetname , |
21 | .Nm tzfree , | | 21 | .Nm tzfree , |
22 | .Nd convert date and time to ASCII | | 22 | .Nd convert date and time to ASCII |
23 | .Sh LIBRARY | | 23 | .Sh LIBRARY |
24 | .Lb libc | | 24 | .Lb libc |
25 | .Sh SYNOPSIS | | 25 | .Sh SYNOPSIS |
26 | .In time.h | | 26 | .In time.h |
27 | .Dv extern char *tzname[2]; | | 27 | .Vt extern char *tzname[2]; |
28 | .Ft char * | | 28 | .Ft char * |
29 | .Fn ctime "const time_t *clock" | | 29 | .Fn ctime "const time_t *clock" |
30 | .Ft char * | | 30 | .Ft char * |
31 | .Fn ctime_r "const time_t *clock" "char *buf" | | 31 | .Fn ctime_r "const time_t *clock" "char *buf" |
32 | .Ft char * | | 32 | .Ft char * |
33 | .Fn ctime_rz "const timezone_t tz" "const time_t *clock" "char *buf" | | 33 | .Fn ctime_rz "const timezone_t tz" "const time_t *clock" "char *buf" |
34 | .Ft double | | 34 | .Ft double |
35 | .Fn difftime "time_t time1" "time_t time0" | | 35 | .Fn difftime "time_t time1" "time_t time0" |
36 | .Ft char * | | 36 | .Ft char * |
37 | .Fn asctime "const struct tm *tm" | | 37 | .Fn asctime "const struct tm *tm" |
38 | .Ft char * | | 38 | .Ft char * |
39 | .Fn asctime_r "const struct tm restrict tm" "char * restrict buf" | | 39 | .Fn asctime_r "const struct tm restrict tm" "char * restrict buf" |
40 | .Ft struct tm * | | 40 | .Ft struct tm * |
| @@ -50,27 +50,27 @@ | | | @@ -50,27 +50,27 @@ |
50 | .Ft time_t | | 50 | .Ft time_t |
51 | .Fn mktime "struct tm *tm" | | 51 | .Fn mktime "struct tm *tm" |
52 | .Ft time_t | | 52 | .Ft time_t |
53 | .Fn mktime_z "const timezone_t tz" "struct tm *tm" | | 53 | .Fn mktime_z "const timezone_t tz" "struct tm *tm" |
54 | .Ft timezone_t | | 54 | .Ft timezone_t |
55 | .Fn tzalloc "const char *zone" | | 55 | .Fn tzalloc "const char *zone" |
56 | .Ft const char * | | 56 | .Ft const char * |
57 | .Fn tzgetname "const timezone_t tz" "int isdst" | | 57 | .Fn tzgetname "const timezone_t tz" "int isdst" |
58 | .Ft void | | 58 | .Ft void |
59 | .Fn tzfree "const timezone_t tz" | | 59 | .Fn tzfree "const timezone_t tz" |
60 | .Sh DESCRIPTION | | 60 | .Sh DESCRIPTION |
61 | .Fn ctime | | 61 | .Fn ctime |
62 | converts a | | 62 | converts a |
63 | .Tp time_t , | | 63 | .Vt time_t , |
64 | pointed to by | | 64 | pointed to by |
65 | .Fa clock , | | 65 | .Fa clock , |
66 | representing the time in seconds since | | 66 | representing the time in seconds since |
67 | 00:00:00 UTC, 1970-01-01, | | 67 | 00:00:00 UTC, 1970-01-01, |
68 | and returns a pointer to a | | 68 | and returns a pointer to a |
69 | string of the form | | 69 | string of the form |
70 | .D1 Thu Nov 24 18:22:48 1986\en\e0 | | 70 | .D1 Thu Nov 24 18:22:48 1986\en\e0 |
71 | Years requiring fewer than four characters are padded with leading zeroes. | | 71 | Years requiring fewer than four characters are padded with leading zeroes. |
72 | For years longer than four characters, the string is of the form | | 72 | For years longer than four characters, the string is of the form |
73 | .D1 Thu Nov 24 18:22:48 81986\en\e0 | | 73 | .D1 Thu Nov 24 18:22:48 81986\en\e0 |
74 | with five spaces before the year. | | 74 | with five spaces before the year. |
75 | These unusual formats are designed to make it less likely that older | | 75 | These unusual formats are designed to make it less likely that older |
76 | software that expects exactly 26 bytes of output will mistakenly output | | 76 | software that expects exactly 26 bytes of output will mistakenly output |
| @@ -323,27 +323,27 @@ and | | | @@ -323,27 +323,27 @@ and |
323 | .Fn localtime_rz , | | 323 | .Fn localtime_rz , |
324 | functions return a pointer to the user-supplied | | 324 | functions return a pointer to the user-supplied |
325 | .Va "struct tm" . | | 325 | .Va "struct tm" . |
326 | On failure they all return | | 326 | On failure they all return |
327 | .Dv NULL | | 327 | .Dv NULL |
328 | and the global variable | | 328 | and the global variable |
329 | .Va errno | | 329 | .Va errno |
330 | is set to indicate the error. | | 330 | is set to indicate the error. |
331 | The | | 331 | The |
332 | .Fn mktime | | 332 | .Fn mktime |
333 | and | | 333 | and |
334 | .Fn mktime_z | | 334 | .Fn mktime_z |
335 | function returns the specified time since the Epoch as a | | 335 | function returns the specified time since the Epoch as a |
336 | .Va time_t | | 336 | .Vt time_t |
337 | type value. | | 337 | type value. |
338 | If the time cannot be represented, then | | 338 | If the time cannot be represented, then |
339 | .Fn mktime | | 339 | .Fn mktime |
340 | and | | 340 | and |
341 | .Fn mktime_z | | 341 | .Fn mktime_z |
342 | return | | 342 | return |
343 | .Va "(time_t)-1" | | 343 | .Va "(time_t)-1" |
344 | setting the global variable | | 344 | setting the global variable |
345 | .Va errno | | 345 | .Va errno |
346 | to indicate the error. | | 346 | to indicate the error. |
347 | The | | 347 | The |
348 | .Fn tzalloc | | 348 | .Fn tzalloc |
349 | function returns a pointer to a | | 349 | function returns a pointer to a |