delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/24/09:00:14

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33,SARE_SUB_PCT_LETTER
X-Spam-Check-By: sourceware.org
Date: Tue, 24 Mar 2009 08:59:52 -0500 (CDT)
From: Richard Narum <rnarum AT ae-solutions DOT com>
To: cygwin <cygwin AT cygwin DOT com>
Message-ID: <1770775685.420301237903192908.JavaMail.root@pat.ae-solutions.com>
Subject: Re: gawk strftime '%z' format not reporting correct offset from UTC
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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

Thanks Corinna, this gets me over my hump.  I've used CST6CDT in the past and if I try it
now it doesn't work either, only if I add the '+' or '-' symbol, i.e. CST+6CDT.  It seems to
me that there might still be something wrong on my Cygwin side because things aren't consistent
with Linux.  I can use TZ=America/Chicago, TZ=CST6CDT or TZ=CST+6CDT and they all work on
Linux.  The date command works fine on Cygwin.  Cygwin only seems to work with CST+6CDT syntax
for gawk.  Anyway, thanks for your insite.

--
Rick 


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019