Eevans added a comment.

In https://phabricator.wikimedia.org/T116247#1748095, @Ottomata wrote:

> > So the producer would store the same time stamp twice? UUID v1 already 
> > contains it.
>
>
> Could you provide an example of what this UUID would look like?
>
> A reason for having a timestamp only field is so that applications can use it 
> for time based logic without having to also know how to extract the timestamp 
> out of an overloaded uuid.


Using Python as an example (and sticking strictly to what's in the standard 
lib):

  from uuid import uuid1
  
  u = uuid1()
  
  print datetime.datetime.fromtimestamp((u.time - 0x01b21dd213814000L)*100/1e9)

The constant `0x01b21dd213814000` represents the number of 100-ns units between 
the epoch that UUIDs use (1582-10-15 00:00:00), and the standard unix epoch.


TASK DETAIL
  https://phabricator.wikimedia.org/T116247

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Eevans
Cc: EBernhardson, Smalyshev, yuvipanda, Hardikj, daniel, aaron, GWicke, 
mobrovac, MZMcBride, bd808, JanZerebecki, Halfak, Krenair, brion, chasemp, 
Eevans, mmodell, Ottomata, Mattflaschen, Matanya, Aklapper, JAllemandou, 
jkroll, Wikidata-bugs, Jdouglas, aude, Deskana, Manybubbles, RobLa-WMF, jeremyb



_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to