This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gawk strftime '%z' format not reporting correct offset from UTC


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 

Richard Narum 

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]