w3c-ccg / http-signatures-test-suite

The HTTP Signatures test suite
Other
8 stars 3 forks source link

Date value is impossibly huge #18

Closed liamdennehy closed 5 years ago

liamdennehy commented 5 years ago

Date.now() is milliseconds, so emitting as unix time is ridiculously large.

https://github.com/w3c-dvcg/http-signatures-test-suite/blob/b54b41ac35ee0d0718ce3cddc04b1f4c3a634627/test/latest/10-canonicalize.js#L238

May also occur elsewhere...

ChristopherA commented 5 years ago

BTW (aka "not an issue but a question), I'm actually seeking a common binary representations of a date and time that isn't as precise (for instance the GMT day is ok for one of them) but isn't broken like like linux time is and is good for long term. Needs to be quite compact as it will be put on blockchains. Any recommendations from masters of esoteric time formats?

aljones15 commented 5 years ago

@liamdennehy have corrected this with proper unix time stamps here:

https://github.com/w3c-dvcg/http-signatures-test-suite/tree/convert-javascript-timestamp-to-unix

That branch is based off of initial so still has some errors in it corrected in this PR:

https://github.com/w3c-dvcg/http-signatures-test-suite/pull/17

aljones15 commented 5 years ago

@ChristopherA perhaps TAI International Atomic Time? https://en.wikipedia.org/wiki/International_Atomic_Time

I'm not a time format master however, but the added precision might work for you.

liamdennehy commented 5 years ago

Seems good, thx