IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

UUID4 - extracting time element


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jzhardy

Active User


Joined: 31 Oct 2006
Posts: 131
Location: brisbane

PostPosted: Thu Apr 22, 2021 1:00 pm
Reply with quote

I'm looking to encode the system timestamp (down to milliseconds or better) into the fewest possible number of bits, and hoping I could cheat by pulling this info directly out of UUID4

a sample generated UUID is:

58d5e212-165b-4ca0-909b-c86b9cee0111

from the definition I get:

Code:

   Field                  Data Type     Octet  Note
                                        #

   time_low               unsigned 32   0-3    The low field of the
                          bit integer          timestamp

   time_mid               unsigned 16   4-5    The middle field of the
                          bit integer          timestamp

   time_hi_and_version    unsigned 16   6-7    The high field of the
                          bit integer          timestamp multiplexed
                                               with the version number 


which means 8 bytes. Can this be improved upon ? And what precision does this actually represent in the seconds part (ie, milliseconds or microseconds) ?
Back to top
View user's profile Send private message
jzhardy

Active User


Joined: 31 Oct 2006
Posts: 131
Location: brisbane

PostPosted: Thu Apr 22, 2021 1:25 pm
Reply with quote

ok, from what i've since learnt, the precision on the low is in 100 nanosecond units. Pls correct me if this is incorrect.

based on that, i could probably lose 13 bits from time_low to keep within millisecond precision.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Parallelization in CICS to reduce res... CICS 4
Search our Forums:

Back to Top