Computer Old Farts Forum
 help / color / mirror / Atom feed
* [COFF] Manipulating time_t values (was: Unix half-billion years old 1985)
       [not found]   ` <CAC0cEp_WX_aXRWnHcat8ZYbdvf8aeudGoU_SA2+Nj0Nc7v9sKA@mail.gmail.com>
@ 2019-11-04 23:00     ` grog
  2019-11-04 23:50       ` bakul
  0 siblings, 1 reply; 4+ messages in thread
From: grog @ 2019-11-04 23:00 UTC (permalink / raw)


[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

Greg
--
Sent from my desktop computer.
Finger grog at lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/coff/attachments/20191105/63c5e336/attachment.sig>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [COFF] Manipulating time_t values (was: Unix half-billion years old 1985)
  2019-11-04 23:00     ` [COFF] Manipulating time_t values (was: Unix half-billion years old 1985) grog
@ 2019-11-04 23:50       ` bakul
  2019-11-05  3:07         ` imp
  0 siblings, 1 reply; 4+ messages in thread
From: bakul @ 2019-11-04 23:50 UTC (permalink / raw)


On Tue, 05 Nov 2019 10:00:55 +1100 Greg 'groggy' Lehey <grog at lemis.com> 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)?

Sorry :-)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [COFF] Manipulating time_t values (was: Unix half-billion years old 1985)
  2019-11-04 23:50       ` bakul
@ 2019-11-05  3:07         ` imp
  2019-11-05 11:13           ` dot
  0 siblings, 1 reply; 4+ messages in thread
From: imp @ 2019-11-05  3:07 UTC (permalink / raw)


On Mon, Nov 4, 2019, 5:00 PM Bakul Shah <bakul at bitblocks.com> wrote:

> On Tue, 05 Nov 2019 10:00:55 +1100 Greg 'groggy' Lehey <grog at lemis.com>
> 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: <http://minnie.tuhs.org/pipermail/coff/attachments/20191104/1f104aee/attachment.html>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [COFF] Manipulating time_t values (was: Unix half-billion years old 1985)
  2019-11-05  3:07         ` imp
@ 2019-11-05 11:13           ` dot
  0 siblings, 0 replies; 4+ messages in thread
From: dot @ 2019-11-05 11:13 UTC (permalink / raw)


Fans of time_t numerology might like my silly palindromic twitter bots,

https://twitter.com/time_t_emit
https://twitter.com/time_x_emit
https://twitter.com/time_o_emit
https://twitter.com/time_b_emit

Tony.
-- 
f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/
Thames, Dover, East Wight: Cyclonic 3 to 5, becoming northerly 5 to 7 later.
Slight or moderate. Thundery showers. Good, occasionally moderate.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-05 11:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <alpine.BSF.2.21.9999.1911050805570.11612@aneurin.horsfall.org>
     [not found] ` <alpine.BSF.2.21.9999.1911050809230.11612@aneurin.horsfall.org>
     [not found]   ` <CAC0cEp_WX_aXRWnHcat8ZYbdvf8aeudGoU_SA2+Nj0Nc7v9sKA@mail.gmail.com>
2019-11-04 23:00     ` [COFF] Manipulating time_t values (was: Unix half-billion years old 1985) grog
2019-11-04 23:50       ` bakul
2019-11-05  3:07         ` imp
2019-11-05 11:13           ` dot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).