segmentio / ksuid

K-Sortable Globally Unique IDs
https://segment.com/blog/a-brief-history-of-the-uuid/
MIT License
4.82k stars 174 forks source link

Wrong epoch date in README? #40

Closed Sanva closed 2 years ago

Sanva commented 5 years ago

Maybe I'm misunderstanding something, but, isn't the date in README wrong?

I mean, where it says

The timestamp epoch is adjusted to March 5th, 2014 [...]

, shouldn't it be May 13th, 2014 ? Given that

go run ./ksuid -f inspect 000000000000000000000000000

outputs

REPRESENTATION:

  String: 000000000000000000000000000
     Raw: 0000000000000000000000000000000000000000

COMPONENTS:

       Time: 2014-05-13 18:53:20 +0200 CEST
  Timestamp: 0
    Payload: 00000000000000000000000000000000
sanvero commented 4 years ago

You are right. Looks like a typo. The used epoch 14e8 equals May 13th 2014 16:53:20 UTC

nharring commented 4 years ago

It never occurred to me to use the cli to inspect the all 0s time, but if you use the timestamp example they give of Time: 2017-10-09 21:00:47 -0700 PDT Timestamp: 107608047 subtracting that many seconds from that date also yields May 13th, 2014 instead of Mar 5, 2014 which matches epoch converter, date and everything else I ran 14e8 through as a timestamp.

Sanva commented 2 years ago

Fixed in PR #51 .