From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7665 invoked by alias); 9 Jun 2011 18:58:20 -0000 Received: (qmail 7657 invoked by uid 22791); 9 Jun 2011 18:58:19 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,TW_YG,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from nm26.bullet.mail.sp2.yahoo.com (HELO nm26.bullet.mail.sp2.yahoo.com) (98.139.91.96) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 09 Jun 2011 18:58:04 +0000 Received: from [98.139.91.61] by nm26.bullet.mail.sp2.yahoo.com with NNFMP; 09 Jun 2011 18:58:04 -0000 Received: from [98.136.185.29] by tm1.bullet.mail.sp2.yahoo.com with NNFMP; 09 Jun 2011 18:58:04 -0000 Received: from [127.0.0.1] by smtp110.mail.gq1.yahoo.com with NNFMP; 09 Jun 2011 18:58:04 -0000 Received: from cgf.cx (cgf@173.48.46.160 with login) by smtp110.mail.gq1.yahoo.com with SMTP; 09 Jun 2011 11:58:03 -0700 PDT X-Yahoo-SMTP: jenXL62swBAWhMTL3wnej93oaS0ClBQOAKs8jbEbx_o- Received: from localhost (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 7E83742804C for ; Thu, 9 Jun 2011 14:58:02 -0400 (EDT) Date: Thu, 09 Jun 2011 18:58:00 -0000 From: Christopher Faylor To: cygwin@cygwin.com Subject: Re: cygcheck's understanding of TZ Message-ID: <20110609185759.GA30563@ednor.casa.cgf.cx> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20110609094631.56364lzi64m7t4d3@messagerie.si.c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-06/txt/msg00091.txt.bz2 On Thu, Jun 09, 2011 at 12:39:04PM -0500, Edward McGuire wrote: >On Thu, Jun 9, 2011 at 02:46, EXCOFFIER Denis > 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