Date: Sat, 21 Aug 2021 07:28:23 +0200 From: Emanuele Torre <torreemanue...@gmail.com> Message-ID: <caa7hnqcx-ivzj02_cua36p1obd3asez_jxncvuv474mk2wk...@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