I am writing a simple bash script for computing time and date by adding seconds onto a random date that I give. It worked fine so far but going from 2016-03-13 00:00:00 to 2016-03-13 03:00:00 skips 2016-03-13 02:00:00.
Verions of bash that I've tried are 4.4.23(1)-release and 5.3.8(1)-release, and they both gave me the same results.
The command below
date -d "2016-03-13 00:00:00 7199 seconds" +%Y-%m-%d-%H-%M-%S
gives
2016-03-13-01-59-59
which is correct. But with
date -d "2016-03-13 00:00:00 7200 seconds" +%Y-%m-%d-%H-%M-%S
I get
2016-03-13-03-00-00
which is supposed to be
2016-03-13-02-00-00
Am I missing something here?
TZ=UTC date -d "2016-03-13 00:00:00 7200 seconds" +%Y-%m-%d-%H-%M-%Sshould work