]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3type/tm.3type
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3type / tm.3type
1 .\" Copyright (c) 2022 by Alejandro Colomar <colomar.6.4.3@gmail.com>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\"
6 .TH TM 3type 2022-06-15 "Linux man-pages (unreleased)"
7 .SH NAME
8 tm \- broken-down time
9 .SH LIBRARY
10 Standard C library
11 .RI ( libc )
12 .SH SYNOPSIS
13 .nf
14 .B #include <time.h>
15 .PP
16 .B struct tm {
17 .BR " int tm_sec;" " /* Seconds [" 0 ", " 60 "] */"
18 .BR " int tm_min;" " /* Minutes [" 0 ", " 59 "] */"
19 .BR " int tm_hour;" " /* Hour [" 0 ", " 23 "] */"
20 .BR " int tm_mday;" " /* Day of the month [" 1 ", " 31 "] */"
21 .BR " int tm_mon;" \
22 " /* Month [" 0 ", " 11 "] (January = " 0 ") */"
23 .BR " int tm_year;" " /* Year minus " 1900 " */"
24 .BR " int tm_wday;" \
25 " /* Day of the week [" 0 ", " 6 "] (Sunday = " 0 ") */"
26 .BR " int tm_yday;" \
27 " /* Day of the year [" 0 ", " 365 "] (Jan/01 = " 0 ") */"
28 .BR " int tm_isdst;" " /* Daylight savings flag */"
29 .PP
30 .BR " long tm_gmtoff;" " /* Seconds East of UTC */"
31 .BR " const char *tm_zone;" " /* Timezone abbreviation */"
32 .B };
33 .fi
34 .PP
35 .RS -4
36 Feature Test Macro Requirements for glibc (see
37 .BR feature_test_macros (7)):
38 .RE
39 .PP
40 .IR tm_gmtoff ,
41 .IR tm_zone :
42 .nf
43 .\" Guarded with __USE_MISC:
44 Since glibc 2.20:
45 _DEFAULT_SOURCE
46 Glibc 2.20 and earlier:
47 _BSD_SOURCE
48 .fi
49 .SH DESCRIPTION
50 Describes time, broken down into distinct components.
51 .PP
52 .I tm_isdst
53 describes whether daylight saving time is in effect at the time described.
54 The value is positive if daylight saving time is in effect,
55 zero if it is not,
56 and negative if the information is not available.
57 .PP
58 .I tm_gmtoff
59 is the difference, in seconds,
60 of the timezone represented by this broken-down time and UTC
61 (this is the additive inverse of
62 .BR timezone (3)).
63 .PP
64 .I tm_zone
65 is the equivalent of
66 .BR tzname (3)
67 for the timezone represented by this broken-down time.
68 .SH VERSIONS
69 In C90,
70 .I tm_sec
71 could represent values in the range
72 .RB [ 0 ", " 61 ],
73 which could represent a double leap second.
74 UTC doesn't permit double leap seconds,
75 so it was limited to
76 .B 60
77 in C99.
78 .SH STANDARDS
79 C90 and later;
80 POSIX.1-2001 and later.
81 .PP
82 .I tm_gmtoff
83 and
84 .I tm_zone
85 originate from 4.3BSD-Tahoe (where
86 .I tm_zone
87 is a
88 .IR "char *" ).
89 .SH NOTES
90 .I tm_sec
91 can represent a leap second with the value
92 .BR 60 .
93 .PP
94 .BR timezone (3),
95 as a variable, is an XSI extension: some systems provide the V7-compatible
96 .\" FreeBSD
97 .BR timezone (3)
98 function.
99 The
100 .I tm_gmtoff
101 field provides an alternative (with the opposite sign) for those systems.
102 .PP
103 .I tm_zone
104 points to static storage and may be overridden on subsequent calls to
105 .BR localtime (3)
106 and similar functions (however, this never happens under glibc).
107 .SH SEE ALSO
108 .BR ctime (3),
109 .BR strftime (3),
110 .BR strptime (3),
111 .BR time (7)