On Sun, May 05, 2013 at 05:43:38PM -0600, Bob Proulx wrote:
> severity 705566 normal
> thanks
> 
> Laurence Maddox wrote:
> > I get this output:
> > Current default time zone: 'America/Chicago'
> > Local time is now:      Tue Apr 16 14:45:29 CDT 2013.
> > Universal Time is now:  Tue Apr 16 19:45:29 UTC 2013.
> 
> Looks okay.  What output did you expect?
> 
> > I need to view on the CLI the time in various timezones.
> > ...
> > I have searched for the "right" way to complete my task, and found a link 
> > here:
> > http://www.linuxquestions.org/questions/programming-9/display-different-timezones-in-command-line-927660/
> > 
> > That link recommends that I complete my task using a command like this one:
> > TZ=UTC date && TZ=CDT date && TZ=IST date
> 
> The concept is reasonable but you must pick a correct timezone for
> what you want to accomplish.  UTC is okay.  But CDT and IST are
> meaningless to libc.  The GNU libc has no concept of invalid
> timezones.  If a timezone doesn't match anything else then the default
> is that it is a name for UTC.  So basically you have asked for UTC
> three times in a row.

I stumbled about a similar thing just now and would consider this
behaviour at least inconsistent:

uwe@taurus:/usr/share/zoneinfo$ TZ=Europe/London date
Fri Aug 12 11:13:34 AM BST 2022
uwe@taurus:/usr/share/zoneinfo$ TZ=BST date
Fri Aug 12 10:13:38 AM BST 2022

The first one is the right one, but there is no way to determine the
latter to be wrong. Apart from the offset the output is identical and if
you're not aware that TZ=BST is wrong you have no chance to notice that.

If it at least said "Fri Aug 12 11:13:38 AM UTC 2022" or (better yet)
dies with an error code that would be highly convenient.

And given that the timezone specifier in the output is "BST" (in both
cases!) noticing that TZ=BST is wrong isn't as trivial as it should be.

Note that using -R doesn't help here either because then I have to
notice that "+0000" is wrong, but to find the offset from me to BST was
the actual task to solve here ...

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature

Reply via email to