Your message dated Thu, 5 Apr 2012 15:59:21 +0200
with message-id <[email protected]>
and subject line Re: gawk: mktime fails when date changes to daylight savings 
time
has caused the Debian Bug report #664959,
regarding gawk: mktime fails when date changes to daylight savings time
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
664959: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=664959
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: gawk
Version: 1:3.1.8+dfsg-0.1
Severity: normal

Dear Maintainer,

With the following program (test.awk):

---<--------------------cut here---------------start------------------->---
{print fix_time($0)}
function fix_time(tstr) {     # tstr=time string field
    if (length(tstr) != 21 || !tstr) {
        return tstr
    } else {
        Y=substr(tstr, 2, 4)
        M=substr(tstr, 7, 2)
        D=substr(tstr, 10, 2)
        h=substr(tstr, 13, 2)
        m=substr(tstr, 16, 2)
        s=substr(tstr, 19, 2)
        t=mktime(sprintf("%s %s %s %s %s %s", Y, M, D, h, m, s))
        return strftime("%Y-%m-%d %H:%M:%S", t)
    }
}
---<--------------------cut here---------------end--------------------->---

$ echo '"2012-03-11 01:00:00"' | gawk -f test.awk
2012-03-11 01:00:00
$ echo '"2012-03-11 02:00:00"' | gawk -f test.awk
2012-03-11 03:00:00
$ echo '"2012-03-11 03:00:00"' | gawk -f test.awk
2012-03-11 03:00:00
$ echo '"2012-03-11 04:00:00"' | gawk -f test.awk
2012-03-11 04:00:00

$ echo '"2012-03-12 01:00:00"' | gawk -f test.awk
2012-03-12 01:00:00
$ echo '"2012-03-12 02:00:00"' | gawk -f test.awk
2012-03-12 02:00:00
$ echo '"2012-03-12 03:00:00"' | gawk -f test.awk
2012-03-12 03:00:00

Daylight savings for my local time zone (Central Time) started on
2012-03-11.  Time is not interpreted correctly for the second hour of
the day when daylight savings starts.


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing-proposed-updates'), (500, 
'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gawk depends on:
ii  libc6        2.13-27
ii  libsigsegv2  2.9-4

gawk recommends no packages.

gawk suggests no packages.

-- no debconf information


-- 
Seb



--- End Message ---
--- Begin Message ---
Version: 1:3.1.8+dfsg-0.1


Hello,

Thanks for your bug report. While the current behavior is surprising,
there is nothing gawk can do about it. The mktime functions is simply
a wrapper around the C/POSIX function with the same name and by design
has the same semantics. This function even explicitly allows out of
range values, as documented in the gawk man page. In comp.lang.awk I
see Geoff Clare reaching the same conclusion. 

Regards,

Jeroen Schot


--- End Message ---

Reply via email to