bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EPOCHREALTIME does not behave correctly before 1970


From: Greg Wooledge
Subject: Re: EPOCHREALTIME does not behave correctly before 1970
Date: Sun, 22 Aug 2021 17:28:17 -0400

On Sun, Aug 22, 2021 at 10:30:26PM +0200, Alex fxmbsw7 Ratchev wrote:
> why disregard or invalid, mark 0 is that date, less is minus, .. all working

It's not that simple.  Calendars get really *interesting* if you go
farther back in history.  The switch from the Julian to the Gregorian
calendar did not happen at the same time in every country.

There's no reason for the implementers of Unix systems to have to worry
about all of that complexity when you call the function that gives the
*current* date and time.  So they don't.

There is no legitimate situation in which gettimeofday() can ever return
a negative value.  Intentionally setting your system clock to a point
in time before the Epoch is simply inviting undefined behaviors and bugs.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]