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: Robert Elz
Subject: Re: EPOCHREALTIME does not behave correctly before 1970
Date: Sat, 21 Aug 2021 22:16:32 +0700

    Date:        Sat, 21 Aug 2021 07:28:23 +0200
    From:        Emanuele Torre <torreemanuele6@gmail.com>
    Message-ID:  
<CAA7hNqcX-ivZJ02_CUa36p1obd3AsEZ_JxnCvuv474MK2wkBvg@mail.gmail.com>

  | I have also read that gettimeofday() is considered obsolete and is
  | deprecated by POSIX.

It is being removed as a required interface, but it still exists
everywhere (and will for a very long time, since so much uses it)
and is just fine if microsecond accuracy is good enough (which it
is for a shell script), and is easily the most portable interface
when better accuracy than just seconds is needed (when seconds are
good enough, time() is even more portable).

This also is 100% irrelevant to the issue you raised, which is not
particularly important, as no-one is likely to be running bash in 1969
or earlier (it didn't exist then) - so unless you've invented time
travel, in any real situation, the real time cannot be before the epoch.

kre




reply via email to

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