-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello, I found a funy page:
http://www.famkruithof.net/uuid/uuidgen?typeReq=-1
It will extract the time stamp from a given version 1 UUID.
Any idea how to do this in java code?
Thanks a lot.
check http://www.ietf.org/rfc/rfc4122.txt
Hi, thanks. For example a UUID: ed37f5f0-4a6a-11de-8a39-0800200c9a66
Fro rfc4122:
4.1.4. Timestamp
The timestamp is a 60-bit value. For UUID version 1, this is
represented by Coordinated Universal Time (UTC) as a count of 100-
nanosecond intervals since 00:00:00.00, 15 October 1582 (the date of
Gregorian reform to the Christian calendar).
For systems that do not have UTC available, but do have the local
time, they may use that instead of UTC, as long as they do so
consistently throughout the system. However, this is not recommended
since generating the UTC from local time only needs a time zone
offset.
I want to know how to convert the timestamp portion (60 bits from left, such as ed37f5f0-4a6a-1de )to a clock time, something like this:
The UUID ed37f5f0-4a6a-11de-8a39-0800200c9a66 contains a timestamp taken at
Wednesday, May 27, 2009 3:03:17 AM GMT
I am new in java and learning zk. Please help in detail, if possible.
It's wikipedia.
Conceptually, the original (version 1) generation scheme for UUIDs was to concatenate the UUID version with the MAC address of the computer that is generating the UUID, and with the number of 100-nanosecond intervals since the adoption of the Gregorian calendar in the West. In practice, the actual algorithm is more complicated. This scheme has been criticized in that it is not sufficiently 'opaque'; it reveals both the identity of the computer that generated the UUID and the time at which it did so.
It seems if you don't provide the Mac address cannot extract it, or even provide it ...still can not reverse the operation....
PS: I'm not sure.
Asked: 2009-05-26 12:53:15 +0800
Seen: 210 times
Last updated: May 27 '09