0

This should be a simple one. I have a date that I want to format that contains hours/minutes/seconds. If I put the date in without the hours it works correctly. If I add the hours the date is incorrect.

$ date --date=2021-09-08 +%c
Wed 08 Sept 2021 12:00:00 AM MDT

$ date --date=2021-09-08T07:00:00 +%c
Tues 07 Sept 2021 06:00:00 PM MDT

The goal is to get 'Wed 08 Sept 2021 07:00:00 AM MDT'

I should add that I'm getting the original date from the output of another program so I can't change it.

1 Answer 1

1

Fixed by adding 'TZ=MST6MDT' beforehand.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .