FreeBSD/contrib/ntp/libntp/ntp_calendar.c
/*
 * Convert a ISO date spec into a second in the NTP time scale,
 * properly truncated to 32 bit.
 */
Convert a ISO date spec into a second in the NTP time scale,
properly truncated to 32 bit.
Convert a ISO date spec into a second in the NTP time scale properly truncated to 32 bit .
vint64
isocal_date_to_ntp64(
	const struct isodate *id
	)
{
	int32_t weeks, days, secs;
	weeks = isocal_weeks_in_years((int32_t)id->year - 1)
	      + (int32_t)id->week - 1;
	days = weeks * 7 + (int32_t)id->weekday;
	secs = ntpcal_etime_to_seconds(id->hour, id->minute, id->second);
	return ntpcal_dayjoin(days - DAY_NTP_STARTS, secs);
}
vint64 isocal_date_to_ntp64 ( const struct isodate * id ) { int32_t weeks , days , secs ; weeks = isocal_weeks_in_years ( ( int32_t ) id -> year - 1 ) + ( int32_t ) id -> week - 1 ; days = weeks * 7 + ( int32_t ) id -> weekday ; secs = ntpcal_etime_to_seconds ( id -> hour , id -> minute , id -> second ) ; return ntpcal_dayjoin ( days - DAY_NTP_STARTS , secs ) ; }
Convert a ISO date spec into a second in the NTP time scale,
 properly truncated to 32 bit.
Convert a ISO date spec into a second in the NTP time scale properly truncated to 32 bit .
/* days is RDN of ISO date now */