]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ntp/libntp/calyearstart.c
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ntp / libntp / calyearstart.c
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 }