xref: /freebsd/contrib/ntp/libntp/calyearstart.c (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1 /*
2  * calyearstart - determine the NTP time at midnight of January 1 in
3  *		  the year of the given date.
4  */
5 #include <sys/types.h>
6 
7 #include "ntp_types.h"
8 #include "ntp_calendar.h"
9 #include "ntp_stdlib.h"
10 
11 u_long
12 calyearstart(u_long ntp_time)
13 {
14     struct calendar jt;
15 
16     caljulian(ntp_time,&jt);
17     jt.yearday  = 1;
18     jt.monthday = 1;
19     jt.month    = 1;
20     jt.hour = jt.minute = jt.second = 0;
21     return caltontp(&jt);
22 }
23