This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: cygcheck's understanding of TZ
On Thu, Jun 9, 2011 at 02:46, EXCOFFIER Denis
<denis.excoffier@c-s.fr> wrote:
> It seems that /usr/bin/cygcheck does not interpret TZ the same way
> as /usr/bin/date does, in the case TZ is set to a file name
> [snip]
> jupiter% (setenv TZ /usr/share/zoneinfo/Europe/Monaco; date; cygdate)
There are two standard syntaxes for TZ. One begins with a timezone
name, the other begins with a colon (:). If you supply a colon, then
the rest of the string is interpreted in an operating system
specific manner. GNU interprets it as a pathname. And Cygwin uses
GNU's time library.
NaÃvely, I thought you might just lack a colon on the front of the
pathname. I confirmed time(1) honors the pathname syntax. But
cygcheck(1) mysteriously interprets all pathnames as GMT + 1 hour:
$ TZ=:/usr/share/zoneinfo/US/Central cygcheck -s | head -3 | tail -1
Current System Time: Thu Jun 09 18:23:42 2011
$ TZ=:/usr/share/zoneinfo/Europe/Monaco cygcheck -s | head -3 | tail -1
Current System Time: Thu Jun 09 18:23:49 2011
$ TZ=:/usr/share/zoneinfo/GMT cygcheck -s | head -3 | tail -1
Current System Time: Thu Jun 09 18:23:56 2011
$ TZ=:/usr/share/zoneinfo/Asia/Calcutta cygcheck -s | head -3 | tail -1
Current System Time: Thu Jun 09 18:23:59 2011
It gets local time right:
$ cygcheck -s | head -3 | tail -1
Current System Time: Thu Jun 09 12:25:04 2011
And it gets GMT right:
$ TZ=GMT cygcheck -s | head -3 | tail -1
Current System Time: Thu Jun 09 17:31:32 2011
So cygcheck(1) is honoring TZ, but it trips over a pathname in a
way that date(1) does not.
Cheers,
MetaEd
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple