leapc
Loading...
Searching...
No Matches
days.h File Reference

Function prototypes for making days from standard time and computing day differences. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double mkdays (int year, int mon, int mday)
 Days of year, month and day of month.
double diff_days (int year1, int year0)
 Compute difference in days between two years.

Detailed Description

Function prototypes for making days from standard time and computing day differences.

Definition in file days.h.

Function Documentation

◆ diff_days()

double diff_days ( int year1,
int year0 )

Compute difference in days between two years.

Parameters
year1Year to compute for.
year0Base year for comparison.
Returns
The difference between the "make time" days in-between the two years and the leap_day() difference.

Definition at line 16 of file days.c.

◆ mkdays()

double mkdays ( int year,
int mon,
int mday )

Days of year, month and day of month.

Uses the standard library's "make time" function to make the number of days for a year, month and month day. Divides the seconds by 86,400 (the number of seconds in a day) in order to answer days rather than seconds.

Parameters
yearYear from 1970.
monOne-based month. Converts to a zero-based month.
mdayDay of the month starting at one.
Note
The standard library's mktime() function has a prescribed minimum start time of 1970. Times cannot precede the first day of that year.

Definition at line 7 of file days.c.