| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: time2posix.3,v 1.13 2003/04/16 13:34:58 wiz Exp $ | | 1 | .\" $NetBSD: time2posix.3,v 1.14 2009/04/11 16:29:09 joerg Exp $ |
2 | .Dd April 1, 2001 | | 2 | .Dd April 1, 2001 |
3 | .Dt TIME2POSIX 3 | | 3 | .Dt TIME2POSIX 3 |
4 | .Os | | 4 | .Os |
5 | .Sh NAME | | 5 | .Sh NAME |
6 | .Nm time2posix , | | 6 | .Nm time2posix , |
7 | .Nm posix2time | | 7 | .Nm posix2time |
8 | .Nd convert seconds since the Epoch | | 8 | .Nd convert seconds since the Epoch |
9 | .Sh LIBRARY | | 9 | .Sh LIBRARY |
10 | .Lb libc | | 10 | .Lb libc |
11 | .Sh SYNOPSIS | | 11 | .Sh SYNOPSIS |
12 | .In time.h | | 12 | .In time.h |
13 | .Ft time_t | | 13 | .Ft time_t |
14 | .Fn time2posix "time_t t" | | 14 | .Fn time2posix "time_t t" |
| @@ -76,36 +76,36 @@ corresponds to a single POSIX | | | @@ -76,36 +76,36 @@ corresponds to a single POSIX |
76 | .Va time_t . | | 76 | .Va time_t . |
77 | .Fn posix2time | | 77 | .Fn posix2time |
78 | is less well-behaved: for a positive leap second hit the result is not | | 78 | is less well-behaved: for a positive leap second hit the result is not |
79 | unique, and for a negative leap second hit the corresponding POSIX | | 79 | unique, and for a negative leap second hit the corresponding POSIX |
80 | .Va time_t | | 80 | .Va time_t |
81 | doesn't exist so an adjacent value is returned. | | 81 | doesn't exist so an adjacent value is returned. |
82 | Both of these are good indicators of the inferiority of the POSIX | | 82 | Both of these are good indicators of the inferiority of the POSIX |
83 | representation. | | 83 | representation. |
84 | .Pp | | 84 | .Pp |
85 | The following table summarizes the relationship between a | | 85 | The following table summarizes the relationship between a |
86 | .Va time_t | | 86 | .Va time_t |
87 | and its conversion to, and back from, the POSIX representation over | | 87 | and its conversion to, and back from, the POSIX representation over |
88 | the leap second inserted at the end of June, 1993. | | 88 | the leap second inserted at the end of June, 1993. |
89 | .Bl -column "93/06/30" "23:59:59" "A+0" "X=time2posix(T)" "posix2time(X) -offset indent | | 89 | .Bl -column "93/06/30" "23:59:59" "A+0" "X=time2posix(T)" "posix2time(X)" -offset indent |
90 | .It Sy DATE TIME T X=time2posix(T) posix2time(X) | | 90 | .It Sy DATE TIME T X=time2posix(T) posix2time(X) |
91 | .It 93/06/30 23:59:59 A+0 B+0 A+0 | | 91 | .It 93/06/30 23:59:59 A+0 B+0 A+0 |
92 | .It 93/06/30 23:59:60 A+1 B+1 A+1 or A+2 | | 92 | .It 93/06/30 23:59:60 A+1 B+1 A+1 or A+2 |
93 | .It 93/07/01 00:00:00 A+2 B+1 A+1 or A+2 | | 93 | .It 93/07/01 00:00:00 A+2 B+1 A+1 or A+2 |
94 | .It 93/07/01 00:00:01 A+3 B+2 A+3 | | 94 | .It 93/07/01 00:00:01 A+3 B+2 A+3 |
95 | .El | | 95 | .El |
96 | .Pp | | 96 | .Pp |
97 | A leap second deletion would look like... | | 97 | A leap second deletion would look like... |
98 | .Bl -column "??/06/30" "23:59:58" "A+0" "X=time2posix(T)" "posix2time(X) -offset indent | | 98 | .Bl -column "??/06/30" "23:59:58" "A+0" "X=time2posix(T)" "posix2time(X)" -offset indent |
99 | .It Sy DATE TIME T X=time2posix(T) posix2time(X) | | 99 | .It Sy DATE TIME T X=time2posix(T) posix2time(X) |
100 | .It ??/06/30 23:59:58 A+0 B+0 A+0 | | 100 | .It ??/06/30 23:59:58 A+0 B+0 A+0 |
101 | .It ??/07/01 00:00:00 A+1 B+2 A+1 | | 101 | .It ??/07/01 00:00:00 A+1 B+2 A+1 |
102 | .It ??/07/01 00:00:01 A+2 B+3 A+2 | | 102 | .It ??/07/01 00:00:01 A+2 B+3 A+2 |
103 | .El | | 103 | .El |
104 | [Note: posix2time(B+1) =\*[Gt] A+0 or A+1] | | 104 | [Note: posix2time(B+1) =\*[Gt] A+0 or A+1] |
105 | .Pp | | 105 | .Pp |
106 | If leap-second support is not enabled, local | | 106 | If leap-second support is not enabled, local |
107 | .Va time_t Ns 's | | 107 | .Va time_t Ns 's |
108 | and POSIX | | 108 | and POSIX |
109 | .Va time_t Ns 's | | 109 | .Va time_t Ns 's |
110 | are equivalent, and both | | 110 | are equivalent, and both |
111 | .Fn time2posix | | 111 | .Fn time2posix |