1dysize(3) Library Functions Manual dysize(3)
2
3
4
6 dysize - get number of days for a given year
7
9 Standard C library (libc, -lc)
10
12 #include <time.h>
13
14 int dysize(int year);
15
16 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
17
18 dysize():
19 Since glibc 2.19:
20 _DEFAULT_SOURCE
21 glibc 2.19 and earlier:
22 _BSD_SOURCE || _SVID_SOURCE
23
25 The function returns 365 for a normal year and 366 for a leap year.
26 The calculation for leap year is based on:
27
28 (year) %4 == 0 && ((year) %100 != 0 || (year) %400 == 0)
29
30 The formula is defined in the macro __isleap(year) also found in
31 <time.h>.
32
34 For an explanation of the terms used in this section, see at‐
35 tributes(7).
36
37 ┌────────────────────────────────────────────┬───────────────┬─────────┐
38 │Interface │ Attribute │ Value │
39 ├────────────────────────────────────────────┼───────────────┼─────────┤
40 │dysize() │ Thread safety │ MT-Safe │
41 └────────────────────────────────────────────┴───────────────┴─────────┘
42
44 None.
45
47 SunOS 4.x.
48
49 This is a compatibility function only. Don't use it in new programs.
50
52 strftime(3)
53
54
55
56Linux man-pages 6.05 2023-07-20 dysize(3)