c++ - How to detect if there is a leap second when using the tm struct? -


according struct tm documentation, value tm_sec can 0 - 61 , range include leap seconds in systems. how can detect if there leap second in system , in opensuse 13.2 machine specifically?

leap seconds not related particular system. not directly informatic problem rather physical one.

in ideal world, every clock accurate, there no reason leap seconds. in our restricted world, clocks tend deviate.

moving system time, specially moving backwards can cause bad things happen. if batch task stores time of last run know files has been processed , because of clock moving backwards thinks time before last run, process again file may plain wrong.

for reason, system developpers invented leap seconds allow system adjust system clock (of course slight deltas, enough if check clock on regular base) without having move backwards.

as noted @supuhstar, operating system implementation of leap seconds. leap seconds have true physical origin , introduced compensate variation between 2 definitions of time utc , tai - physically variations in earth rotation speed. give more details on in other post of mine


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -