From mboxrd@z Thu Jan 1 00:00:00 1970 From: imp at bsdimp.com (Warner Losh) Date: Mon, 4 Nov 2019 20:07:07 -0700 Subject: [COFF] Manipulating time_t values (was: Unix half-billion years old 1985) In-Reply-To: <20191104235025.C0548156E80B@mail.bitblocks.com> References: <20191104230055.GH68439@eureka.lemis.com> <20191104235025.C0548156E80B@mail.bitblocks.com> Message-ID: On Mon, Nov 4, 2019, 5:00 PM Bakul Shah wrote: > On Tue, 05 Nov 2019 10:00:55 +1100 Greg 'groggy' Lehey > wrote: > > > > [Moved to COFF] > > > > On Monday, 4 November 2019 at 16:59:22 -0500, John P. Linderman wrote: > > > I wrote a near-trivial "timestamp" command to make it easier to do time > > > arithmetic > > > > > > TZ=udt timestamp > > > 119 11 04 21 50 06 18204 1572904206 Mon Nov 4 21:50:06 2019 > > > TZ=udt timestamp 0 > > > 70 01 01 00 00 00 0 0 Thu Jan 1 00:00:00 1970 > > > ... > > > > FreeBSD has this functionality in date(1): > > > > TZ=UTC date -r 500000000 > > Tue 5 Nov 1985 00:53:20 UTC > > TZ=UTC date -r 1500000000 > > Fri 14 Jul 2017 02:40:00 UTC > > Shouldn't that be > Tue 5 Nov 1985 00:52:57 UTC > Fri 14 Jul 2017 02:39:23 UTC > given that this is UTC (which is 37 seconds behind TAI)? > The delta was closer to 18 in 1985 and 36 on 2017. But that doesn't matter. Sorry :-) > No. POSIX says leap seconds do not exist for the computation of these numbers. Greg's numbers are POSIXly correct. Warner _______________________________________________ > COFF mailing list > COFF at minnie.tuhs.org > https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff > -------------- next part -------------- An HTML attachment was scrubbed... URL: