Closed konomikitten closed 4 years ago
Hi Konomi, did you see that you can do
$ dateconv now --zone 'Australia/Melbourne'
For today this wouldn't work as the date is time-less. You'd have to use now
and -f %F
.
The rationale behind this is part platform-independence (there's so many ways where local time can be specified) and part design: The tools are supposed to produce the same output given equal inputs on any system. Most of the tools, however, specifically allow to hand in a source time zone as well as a target time zone.
I mean I can do that with date
as well but I'm looking to do:
dateutils.ddiff 2020-10-17T15:30+11:00 now -f "%d %H"
Rather than having to do:
dateutils.ddiff 2020-10-17T15:30+11:00 $(date --iso-8601=minutes) -f "%d %H"
Ideally as I stated originally it would be nice if ddiff
allowed for using localtime rather than UTC?
Yes well, I'd say:
$ dateutils.ddiff 2020-10-17T15:30 now -f "%d %H" --from-zone Australia/Melbourne
should work. Takes both times as Melbourne stamps.
Thanks that's what I was after I did see that flag in the manual for ddiff
I just didn't realise it would apply to the special for now
.
No worries.
now
,today
and the specials seem handy but they all give time stamps in UTC where as I am working with local time. So this is either a feature request to give us a way to use the specials but with local time values or a question on how to do that with the current version as I can't seem to find a way to makenow
be expressed in local time?