Seconds from 19xx to Date (and visa versa)

Guy Harris guy at auspex.UUCP
Sat Oct 29 15:22:00 AEST 1988


>...I propose that we define the time kept by Unix as follows:
>
>	time = (
>		(number of whole years since the epoch) * 365
>		+
>		(number of leap days since the epoch)
>	       )
>	       *
>	       24*3600
>	      +
>	       (number of seconds since 00:00 this morning).

If you change that to:

	time = (
		(number of whole years since the epoch) * 365
		+
		(number of leap days since the epoch)
		+
		(number of days since the first day of this year)
	       )
	       *
	       24*3600
	      +
	       (number of seconds since 00:00 this morning).

(or perform some equivalent transformation, so UNIX doesn't think it's
always January 1) I'd vote for that, especially since, as I understand
it, it's precisely what POSIX specifies (traditional UNIX time, no
leap-second correction). 



More information about the Comp.lang.c mailing list