Path: utzoo!utgpu!water!watmath!clyde!burl!codas!cpsc6a!rtech!amdahl!chongo From: chongo@amdahl.amdahl.com (Landon Curt Noll) Newsgroups: comp.bugs.4bsd Subject: Re: ctime(3) and leap seconds :-) Keywords: ctime, leap second, epoch Message-ID: <20532@amdahl.amdahl.com> Date: 9 Jan 88 04:44:26 GMT References: <604@PT.CS.CMU.EDU> <6976@brl-smoke.ARPA> Reply-To: chongo@amdahl.amdahl.com (Landon Curt Noll) Organization: Amdahl Coup, UTS Products Hen House Lines: 29 In article <6976@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: > >The C library time routines are not PERMITTED to know about leap >seconds, according to the current draft proposed ANSI C standard. >You should set the system clock so that ctime() reports the correct >time of day. I'm opening myself to flames here, but here I go anyway: Yes, I was the one who proposed the following definition which is now in the P1003.1 Draft 12 standard: Epoch: The Epoch refers to the time at 0 hours, 0 minutes 0 seconds, Coordinated Universal Time on January 1, 1970. The value "seconds since the Epoch" refers to the difference in seconds between the referenced time and the Epoch, not counting leap seconds. The function ctime() converts "seconds since the Epoch" into a date/time. The fix from CMU violates the standard. The reason why this was put into the standard was to avoid having to put things like this fix into your code. (most systems do not do this, so the standard reflects this) chongo <> /\oo/\ -- [views above shouldn't be viewed as Amdahl views, or as views from Amdahl, or as Amdahl views views, or as views by Mr. Amdahl, or as views from his house]