Date command not working properly for America/Bogota timezone

0

On RHEL 7.2 I have set the timezone to "America/Bogota (COT)" With that, if I execute date command it works fine, But if I try to get the UTC timestamp for given timestamp where the timezone is Bogota (COT) it fails.

Redhat release:

root >more /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)
date and timedatectl output

root >date
Thu Feb 13 04:50:00 COT 2020

root >timedatectl
      Local time: Thu 2020-02-13 04:50:05 COT
  Universal time: Thu 2020-02-13 09:50:05 UTC
        RTC time: Thu 2020-02-13 04:50:05
       Time zone: America/Bogota (COT, -0500)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

Now if I execute the following command to convert the date to UTC format it fails as the timezone is COT.

root >date -u -d  "Thu 2020-02-13 04:50:05 COT"
date: invalid date ‘Thu 2020-02-13 04:50:05 COT’

Whereas if I just change the timezone to something else it works without any issue.

root >date -u -d  "Thu 2020-02-13 04:50:05 CET"
Thu Feb 13 03:50:05 UTC 2020

Have you seen such an issue before for the COT timezone? Is there any solution for the same?

user2064119

Posted 2020-02-13T11:45:29.103

Reputation: 1

Solution: date -u -d 'TZ="America/Bogota" 2020-02-13 04:50:05' – user2064119 – 2020-02-14T14:11:32.590

The concern is why the date command mentioned in the question works (CET) for one timezone and not for others (COT)? – user2064119 – 2020-02-14T14:18:52.687

No answers