Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Bob_Zimmerman
Authority
Authority

POSIX time weirdness

While looking at some objects in my R80.20 jumbo 33 SmartCenter, I noticed the "posix" values for creation and modification dates have too many digits. POSIX time is seconds since 1970-01-01T00:00:00Z, minus leap seconds. The largest value which can be represented with a 32-bit counter is 2,147,483,647, leading to the 2038 problem. I'm seeing values like 1,567,547,444,907.

The first ten digits match POSIX time for when I believe the object was last changed. Maybe the extras are for milliseconds? If so, calling it POSIX time is incorrect.

Can anybody explain what is going on?

0 Kudos
2 Replies
PhoneBoy
Admin
Admin

It's most definitely milliseconds.
From what I can tell, some implementations of POSIX time do seconds, others do milliseconds, and others still do microseconds.
0 Kudos
Bob_Zimmerman
Authority
Authority

Good to know. Definitely not POSIX-compliant time representation, though. As of IEEE Std 1003.1-2017, POSIX specified in sys/time.h that the timeval struct shall contain time_t (time in seconds) and suseconds_t (time since time_t in microseconds). It doesn't specify the time has to only be 32-bits, but it does separate the whole seconds from the fractional seconds.

The specification for the 'date' utility doesn't even include options for sub-second output.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events