FreeBSD/contrib/ntp/libntp/calyearstart.c
/*
 * calweekstart - get NTP time at midnight of the last monday on or
 * before the current date.
 */
get NTP time at midnight of the last monday on or
before the current date.
get NTP time at midnight of the last monday on or before the current date .
u_int32
calweekstart(u_int32 ntptime, const time_t *pivot)
{
	u_int32      ndays; 
	vint64       vlong;
	ntpcal_split split;
	vlong = ntpcal_ntp_to_ntp(ntptime, pivot);
	split = ntpcal_daysplit(&vlong);
	ndays = ntpcal_weekday_le(split.hi + DAY_NTP_STARTS, CAL_MONDAY)
	      - DAY_NTP_STARTS;
	return (u_int32)(ndays * SECSPERDAY);
}
u_int32 calweekstart ( u_int32 ntptime , const time_t * pivot ) { u_int32 ndays ; vint64 vlong ; ntpcal_split split ; vlong = ntpcal_ntp_to_ntp ( ntptime , pivot ) ; split = ntpcal_daysplit ( & vlong ) ; ndays = ntpcal_weekday_le ( split . hi + DAY_NTP_STARTS , CAL_MONDAY ) - DAY_NTP_STARTS ; return ( u_int32 ) ( ndays * SECSPERDAY ) ; }
calweekstart - get NTP time at midnight of the last monday on or
 before the current date.
calweekstart - get NTP time at midnight of the last monday on or before the current date .
/* elapsed days since NTP starts */