| 1 |
'\" t |
| 2 |
.\" Copyright 2001, Walter Harms <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH dysize 3 2026-02-08 "Linux man-pages 6.18" |
| 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 |
.P |
| 17 |
.BI "int dysize(int " year ); |
| 18 |
.fi |
| 19 |
.P |
| 20 |
.RS -4 |
| 21 |
Feature Test Macro Requirements for glibc (see |
| 22 |
.BR feature_test_macros (7)): |
| 23 |
.RE |
| 24 |
.P |
| 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 |
.P |
| 36 |
.in +4n |
| 37 |
.EX |
| 38 |
(year) %4 == 0 && ((year) %100 != 0 || (year) %400 == 0) |
| 39 |
.EE |
| 40 |
.in |
| 41 |
.P |
| 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 |
.TS |
| 50 |
allbox; |
| 51 |
lbx lb lb |
| 52 |
l l l. |
| 53 |
Interface Attribute Value |
| 54 |
T{ |
| 55 |
.na |
| 56 |
.nh |
| 57 |
.BR dysize () |
| 58 |
T} Thread safety MT-Safe |
| 59 |
.TE |
| 60 |
.SH STANDARDS |
| 61 |
None. |
| 62 |
.SH HISTORY |
| 63 |
SunOS 4.x. |
| 64 |
.P |
| 65 |
This is a compatibility function only. |
| 66 |
Don't use it in new programs. |
| 67 |
.\" The SCO version of this function had a year-2000 problem. |
| 68 |
.SH SEE ALSO |
| 69 |
.BR strftime (3) |