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