FreeBSD/contrib/ntp/ntpd/refclock_ripencc.c
/* convert time of week into day-hour-minute-second and print */
convert time of week into day-hour-minute-second and print
convert time of week into day - hour - minute - second and print
char *
show_time(
	  float time_of_week
	  )
{
	short	days, hours, minutes;
	float seconds;
	double tow = 0;
	static char timestring [80];
	if (time_of_week == -1.0)
	{
		sprintf(timestring, "   <No time yet>   ");
	}
	else if ((time_of_week >= 604800.0) || (time_of_week < 0.0))
	{
		sprintf(timestring, "     <Bad time>     ");
	}
	else
	{
		if (time_of_week < 604799.9) 
			tow = time_of_week + .00000001;
		seconds = (float)fmod(tow, 60.);
		minutes =  (short) fmod(tow/60., 60.);
		hours = (short)fmod(tow / 3600., 24.);
		days = (short)(tow / 86400.0);
		sprintf(timestring, " %s %02d:%02d:%05.2f   ",
			dayname[days], hours, minutes, seconds);
	}
	return timestring;
}
char * show_time ( float time_of_week ) { short days , hours , minutes ; float seconds ; double tow = 0 ; static char timestring [ 80 ] ; if ( time_of_week == -1.0 ) { sprintf ( timestring , " " ) ; } else if ( ( time_of_week >= 604800.0 ) || ( time_of_week < 0.0 ) ) { sprintf ( timestring , " " ) ; } else { if ( time_of_week < 604799.9 ) tow = time_of_week + .00000001 ; seconds = ( float ) fmod ( tow , 60. ) ; minutes = ( short ) fmod ( tow / 60. , 60. ) ; hours = ( short ) fmod ( tow / 3600. , 24. ) ; days = ( short ) ( tow / 86400.0 ) ; sprintf ( timestring , " " , dayname [ days ] , hours , minutes , seconds ) ; } return timestring ; }
convert time of week into day-hour-minute-second and print
convert time of week into day - hour - minute - second and print