public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: cygcheck's understanding of TZ
Date: Thu, 09 Jun 2011 18:58:00 -0000	[thread overview]
Message-ID: <20110609185759.GA30563@ednor.casa.cgf.cx> (raw)
In-Reply-To: <BANLkTinwkd50q5JdugNRO8wfQrJ00syD+w@mail.gmail.com>

On Thu, Jun 09, 2011 at 12:39:04PM -0500, Edward McGuire wrote:
>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.

If by "Cygwin" you mean the dll, then it doesn't use GNU's time library
but it does try to match the same behavior.

>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

cygcheck is a non-Cygwin application.  It is not surprising that it would
not interpret TZ in a way that is consistent with linux.  It really
makes no sense at all to use cygcheck as some sort of method to report
the system time.  Use 'date(1)'.

>$ 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.

And date(1) is what you should be using.

cgf

--
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

      parent reply	other threads:[~2011-06-09 18:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09  7:47 EXCOFFIER Denis
2011-06-09  7:54 ` Thomas Wolff
2011-06-09 17:44   ` Buchbinder, Barry (NIH/NIAID) [E]
2011-06-09 17:39 ` Edward McGuire
2011-06-09 18:08   ` Charles Wilson
2011-06-09 19:27     ` Edward McGuire
2011-06-09 19:50       ` Denis Excoffier
2011-06-09 21:06         ` Christopher Faylor
2011-06-09 22:01           ` Edward McGuire
2011-06-10  7:25           ` Denis Excoffier
2011-06-10 14:07             ` Edward McGuire
2011-06-10 14:30             ` Christopher Faylor
2011-06-10 17:44               ` Denis Excoffier
2011-06-13 15:07                 ` Edward McGuire
2011-06-13 15:34                   ` Christopher Faylor
2011-06-14 15:05                     ` Lee Maschmeyer
2011-06-14 15:28                       ` Christopher Faylor
2011-06-14 17:30                         ` Lee Maschmeyer
2011-06-14 17:51                           ` Edward McGuire
2011-06-14 18:35                             ` Lee Maschmeyer
2011-06-14 19:19                               ` Edward McGuire
2011-06-14 19:22                                 ` Christopher Faylor
2011-06-14 19:21                           ` Christopher Faylor
2011-06-09 18:58   ` Christopher Faylor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110609185759.GA30563@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).