ctime.3 (84306) | ctime.3 (108037) |
---|---|
1.\" Copyright (c) 1989, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" Arthur Olson. 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 18 unchanged lines hidden (view full) --- 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 | 1.\" Copyright (c) 1989, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" Arthur Olson. 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 18 unchanged lines hidden (view full) --- 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 |
35.\" $FreeBSD: head/lib/libc/stdtime/ctime.3 84306 2001-10-01 16:09:29Z ru $ | 35.\" $FreeBSD: head/lib/libc/stdtime/ctime.3 108037 2002-12-18 12:45:11Z ru $ |
36.\" 37.Dd January 2, 1999 38.Dt CTIME 3 39.Os 40.Sh NAME 41.Nm asctime , 42.Nm asctime_r , 43.Nm ctime , --- 91 unchanged lines hidden (view full) --- 135.Fn localtime , 136and returns a pointer to a 26-character string of the form: 137.Bd -literal -offset indent 138Thu Nov 24 18:22:48 1986\en\e0 139.Ed 140.Pp 141All the fields have constant width. 142.Pp | 36.\" 37.Dd January 2, 1999 38.Dt CTIME 3 39.Os 40.Sh NAME 41.Nm asctime , 42.Nm asctime_r , 43.Nm ctime , --- 91 unchanged lines hidden (view full) --- 135.Fn localtime , 136and returns a pointer to a 26-character string of the form: 137.Bd -literal -offset indent 138Thu Nov 24 18:22:48 1986\en\e0 139.Ed 140.Pp 141All the fields have constant width. 142.Pp |
143The |
|
143.Fn ctime_r | 144.Fn ctime_r |
145function |
|
144provides the same functionality as 145.Fn ctime 146except the caller must provide the output buffer 147.Fa buf 148to store the result, which must be at least 26 characters long. | 146provides the same functionality as 147.Fn ctime 148except the caller must provide the output buffer 149.Fa buf 150to store the result, which must be at least 26 characters long. |
151The |
|
149.Fn localtime_r 150and 151.Fn gmtime_r | 152.Fn localtime_r 153and 154.Fn gmtime_r |
155functions |
|
152provide the same functionality as 153.Fn localtime 154and 155.Fn gmtime 156respectively, except the caller must provide the output buffer 157.Fa result . 158.Pp 159The 160.Fn asctime 161function 162converts the broken down time in the structure 163.Fa tm 164pointed at by 165.Fa *tm 166to the form 167shown in the example above. 168.Pp | 156provide the same functionality as 157.Fn localtime 158and 159.Fn gmtime 160respectively, except the caller must provide the output buffer 161.Fa result . 162.Pp 163The 164.Fn asctime 165function 166converts the broken down time in the structure 167.Fa tm 168pointed at by 169.Fa *tm 170to the form 171shown in the example above. 172.Pp |
173The |
|
169.Fn asctime_r | 174.Fn asctime_r |
175function |
|
170provides the same functionality as 171.Fn asctime 172except the caller provide the output buffer 173.Fa buf 174to store the result, which must be at least 26 characters long. 175.Pp 176The functions 177.Fn mktime 178and 179.Fn timegm 180convert the broken-down time in the structure 181pointed to by tm into a time value with the same encoding as that of the 182values returned by the 183.Xr time 3 184function (that is, seconds from the Epoch, 185.Tn UTC ) . | 176provides the same functionality as 177.Fn asctime 178except the caller provide the output buffer 179.Fa buf 180to store the result, which must be at least 26 characters long. 181.Pp 182The functions 183.Fn mktime 184and 185.Fn timegm 186convert the broken-down time in the structure 187pointed to by tm into a time value with the same encoding as that of the 188values returned by the 189.Xr time 3 190function (that is, seconds from the Epoch, 191.Tn UTC ) . |
192The |
|
186.Fn mktime | 193.Fn mktime |
194function |
|
187interprets the input structure according to the current timezone setting 188(see 189.Xr tzset 3 ) . | 195interprets the input structure according to the current timezone setting 196(see 197.Xr tzset 3 ) . |
198The |
|
190.Fn timegm | 199.Fn timegm |
200function |
|
191interprets the input structure as representing Universal Coordinated Time 192.Pq Tn UTC . 193.Pp 194The original values of the 195.Fa tm_wday 196and 197.Fa tm_yday 198components of the structure are ignored, and the original values of the --- 36 unchanged lines hidden (view full) --- 235are set to represent the specified calendar time, but with their values 236forced to their normal ranges; the final value of 237.Fa tm_mday 238is not set until 239.Fa tm_mon 240and 241.Fa tm_year 242are determined. | 201interprets the input structure as representing Universal Coordinated Time 202.Pq Tn UTC . 203.Pp 204The original values of the 205.Fa tm_wday 206and 207.Fa tm_yday 208components of the structure are ignored, and the original values of the --- 36 unchanged lines hidden (view full) --- 245are set to represent the specified calendar time, but with their values 246forced to their normal ranges; the final value of 247.Fa tm_mday 248is not set until 249.Fa tm_mon 250and 251.Fa tm_year 252are determined. |
243.Fn Mktime | 253The 254.Fn mktime 255function |
244returns the specified calendar time; if the calendar time cannot be 245represented, it returns \-1; 246.Pp 247The 248.Fn difftime 249function 250returns the difference between two calendar times, 251.Pf ( Fa time1 --- 112 unchanged lines hidden --- | 256returns the specified calendar time; if the calendar time cannot be 257represented, it returns \-1; 258.Pp 259The 260.Fn difftime 261function 262returns the difference between two calendar times, 263.Pf ( Fa time1 --- 112 unchanged lines hidden --- |