X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Mon, 23 Mar 2009 22:50:26 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: gawk strftime '%z' format not reporting correct offset from UTC
Message-ID: <20090323215026.GD20568@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <799129936.415411237841700686.JavaMail.root@pat.ae-solutions.com> <444718016.415531237842006607.JavaMail.root@pat.ae-solutions.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <444718016.415531237842006607.JavaMail.root@pat.ae-solutions.com>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Mar 23 16:00, Richard Narum wrote:
> All,
> 
> I may have found a bug in the Cygwin version of gawk or maybe I'm missing something.  As the information below depicts the GNU date '%z' format is working but the '%z' format under gawk's strftime function is not reporting the correct offset from UTC for me.  I've tested this on Linux and gawk is reporting correctly.  Any suggestions would be greatly appreciated.  
> 
> $ cat /proc/version 
> CYGWIN_NT-5.1 1.5.24(0.156/4/2) 2007-01-31 10:57 
> $ cygcheck -c tzcode 
> Cygwin Package Information 
> Package Version Status 
> tzcode 2008h-1 OK 
> $ date --version 
> date (GNU coreutils) 6.10 
> $ gawk --version 
> GNU Awk 3.1.6 
> $ export TZ=America/Chicago 
> $ date --date='8 Mar 2009' +'%c %z %Z' 
> Sun Mar 8 00:00:00 2009 -0600 CST 
> $ date --date='9 Mar 2009' +'%c %z %Z' 
> Mon Mar 9 00:00:00 2009 -0500 CDT 
> $ gawk 'BEGIN{print strftime("%c %z %Z",mktime("2009 3 8 0 0 0"))}' 
> Sun Mar 8 00:00:00 2009 +0000 CST 
> $ gawk 'BEGIN{print strftime("%c %z %Z",mktime("2009 3 9 0 0 0"))}' 
> Mon Mar 9 00:00:00 2009 +0000 CDT 

AFAICS, it's the "modern" style of TZ which isn't handled by the
internal time functions.  Unsetting TZ should work, though.  Or set it
to TZ=CST-5CDT


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

