uuid6 / uuid6-ietf-draft

Next Generation UUID Formats
https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
187 stars 11 forks source link

Draft 03 Final #95

Closed kyzer-davis closed 2 years ago

kyzer-davis commented 2 years ago

@bradleypeabody's Updates passed to me via email to merge:

sergeyprokhorenko commented 2 years ago

This sentence is not clear:  number of milliseconds seconds since

kyzer-davis commented 2 years ago

This sentence is not clear:  number of milliseconds seconds since

@sergeyprokhorenko, I am not sure what causes your reading view to abruptly stop but there is definitely more to that sentence.

kyzer-davis commented 2 years ago
sergeyprokhorenko commented 2 years ago

This sentence is not clear:  number of milliseconds seconds since

@sergeyprokhorenko, I am not sure what causes your reading view to abruptly stop but there is definitely more to that sentence.

UUID version 7 features a time-ordered value field derived from the widely implemented and well known Unix Epoch timestamp source, the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded.

Lost OR between millisecondsand seconds. I would prefer only milliseconds

broofa commented 2 years ago

I believe unix epoch is traditionally defined as the number of seconds, fwiw.

sergeyprokhorenko commented 2 years ago

I believe unix epoch is traditionally defined as the number of seconds, fwiw.

We can drop the term unix epoch for milliseconds

fabiolimace commented 2 years ago

We can just remove the word "seconds" from the sentence.

the number of milliseconds seconds since midnight 1 Jan 1970 UTC.

Although time counting in Unix was done in seconds, the use of the expression "unix epoch" is just to indicate a point in time when the time count starts, not the time precision. This point in time is known as the "Unix epoch", so I think it's okay to use the term.

I did a little search to find out what is the most common way to refer to timestamps returned by functions. It seems to me that the most common way is "x since January 1, 1970 UTC", where x is the time fraction name (second, millisecond, microsecond etc).

Java

[public static long currentTimeMillis()](https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/System.html#currentTimeMillis()):

Returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.

Python

time.time() → float

Return the time in seconds since the epoch as a floating point number. The specific date of the epoch and the handling of leap seconds is platform dependent.

The epoch is the point where the time starts, and is platform dependent. For Unix, the epoch is January 1, 1970, 00:00:00 (UTC). To find out what the epoch is on a given platform, look at time.gmtime(0). The term seconds since the epoch refers to the total number of elapsed seconds since the epoch, typically excluding leap seconds. Leap seconds are excluded from this total on all POSIX-compliant platforms.

Go

func (t Time) UnixMilli() int64

UnixMilli returns t as a Unix time, the number of milliseconds elapsed since January 1, 1970 UTC.

Javascript

Date Time Values and Time Range

Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC. In time values leap seconds are ignored.

PHP

microtime(bool $as_float = false): string|float

microtime() returns the current Unix timestamp with microseconds. This function is only available on operating systems that support the gettimeofday() system call.

Bash

date +"%s"

seconds since 1970-01-01 00:00:00 UTC

bradleypeabody commented 2 years ago

Thanks @fabiolimace, that's pretty much exactly the reply I was just about to type.