tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / dysize.3
blobf3e1a888857d96b343989e038dd1c8e5120c3e65
1 '\" t
2 .\"  Copyright 2001 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" aeb: some corrections
7 .TH dysize 3 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 dysize \- get number of days for a given year
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ", " \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B "#include <time.h>"
16 .PP
17 .BI "int dysize(int " year );
18 .fi
19 .PP
20 .RS -4
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .RE
24 .PP
25 .BR dysize ():
26 .nf
27     Since glibc 2.19:
28         _DEFAULT_SOURCE
29     glibc 2.19 and earlier:
30         _BSD_SOURCE || _SVID_SOURCE
31 .fi
32 .SH DESCRIPTION
33 The function returns 365 for a normal year and 366 for a leap year.
34 The calculation for leap year is based on:
35 .PP
36 .in +4n
37 .EX
38 (year) %4 == 0 && ((year) %100 != 0 || (year) %400 == 0)
39 .EE
40 .in
41 .PP
42 The formula is defined in the macro
43 .I __isleap(year)
44 also found in
45 .IR <time.h> .
46 .SH ATTRIBUTES
47 For an explanation of the terms used in this section, see
48 .BR attributes (7).
49 .ad l
50 .nh
51 .TS
52 allbox;
53 lbx lb lb
54 l l l.
55 Interface       Attribute       Value
57 .BR dysize ()
58 T}      Thread safety   MT-Safe
59 .TE
60 .hy
61 .ad
62 .sp 1
63 .SH STANDARDS
64 This function occurs in SunOS 4.x.
65 .SH NOTES
66 This is a compatibility function only.
67 Don't use it in new programs.
68 .\" The SCO version of this function had a year-2000 problem.
69 .SH SEE ALSO
70 .BR strftime (3)