dateutils icon indicating copy to clipboard operation
dateutils copied to clipboard

dateconv doesn't convert time between TZs when full date not specified

Open kyrias opened this issue 7 years ago • 3 comments

In the dateconv manpage it says that -b is used for underspecified inputs, and that it defaults to the current date and time, which makes it sounds like the following command should assume the current date for the missing data, and just convert the time between the timezones:

dateconv --from-zone America/Chicago --zone Europe/Berlin '12:00' -i '%H:%M' -f '%T'

Which should print 19:00:00, but in fact just prints out the given time (12:00:00) instead. Passing a full date does make it work however:

dateconv --from-zone America/Chicago --zone Europe/Berlin '2017-11-20 12:00' -i '%F %H:%M' -f '%T'

kyrias avatar Nov 20 '17 15:11 kyrias

Ah good catch. I must say I hate automagic stuff (like the --base|-b thing). But who am I to contradict popular demand.

See 8e7bd70b for a "fix".

hroptatyr avatar Nov 21 '17 11:11 hroptatyr

Awesome, thanks. This does make quick time conversions a lot simpler.

Do you have any rough timeframe of when you expect to tag a new release by the way? No hurry though, as I can just use the git build for now.

kyrias avatar Nov 21 '17 12:11 kyrias

Hm, I don't I'm afraid. Normally I release on urgent bug fixes or when the IERS publishes information about leap seconds. Assuming no urgent bug fixes that would be March 2018 then.

hroptatyr avatar Nov 21 '17 13:11 hroptatyr