PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/contrib/ntp/libntp/calyearstart.c

https://bitbucket.org/freebsd/freebsd-head/
C | 22 lines | 15 code | 3 blank | 4 comment | 0 complexity | bb422c5b43e86d17625fa1562d04ee64 MD5 | raw file
 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
11u_long
12calyearstart(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}