[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Option to Disable DST
From: |
Aharon Robbins |
Subject: |
Re: [bug-gawk] Option to Disable DST |
Date: |
Sun, 02 Oct 2011 20:59:59 +0200 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Hi. Sorry for the delay in replying.
> Date: Wed, 7 Sep 2011 09:07:21 -0700 (PDT)
> From: Gustavo San Roman <address@hidden>
> To: "address@hidden" <address@hidden>
> Subject: [bug-gawk] Option to Disable DST
>
> Hi,
>
> I'm writing an
> script that needs to do things for every day in a period, so to increase the
> day I was doing "DateBegin += 24*60*60" that seemed to work ok, but I
> noticed some missing and repeated dates in some conditions, tracing the
> results
> it happen when the DST comes into effect (or goes away).
Makes sense.
> The following
> code gives the correct list, but using the original method (commented), when
> the DateBegin is "2011 11 06 00 00 00" and I add "24*60*60"
> became "2011 11 06 23 00 00" and that coincides with the DST change,
> I have not found any way to disable the DST when adding time to a date or just
> disabling completely the DST for the script or any other way to add a day to a
> date.
>
> ????? DateBegin =
> mktime("20111001");
This isn't a valid date spec for mktime, since you're supposed to separate
the components with spaces.
> DateList = DateList "," strftime("%Y%m%d",DateBegin);
With gawk 4.0, strftime accepts a third argument, which if non-zero
or non-null, says to use UTC.
An alternative is to run your script with the environment variable TZ=UTC.
I suspect that one of these options will work for you.
Hope this helps,
Arnold
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [bug-gawk] Option to Disable DST,
Aharon Robbins <=