[BUGS] Don't get caught this sunday with no DST changes

Edwin Groothuis edwin at mavetju.org
Thu Mar 27 20:39:30 EST 2008


On Thu, Mar 27, 2008 at 08:35:10PM +1100, jonathan michaels wrote:
> > > $ perl -e 'use POSIX;print "Date = ", POSIX::ctime(1206529200 + 86400 * 0);'
> > > Date = Wed Mar 26 22:00:00 2008
> > > 
> > > $ perl -e 'use POSIX;print "Date = ", POSIX::ctime(1206529200 + 86400 * 7);'
> > > Date = Wed Apr  2 22:00:00 2008
> > > 
> > > $ perl -e 'use POSIX;print "Date = ", POSIX::ctime(1206529200 + 86400 * 14);'
> > > Date = Wed Apr  9 21:00:00 2008
> > > 
> > > i thought i'd gotten it nailed but then i tried the last one
> > > and saw the 21:00:00, again.  just to check if it is not an
> > > anomily i also tried one at 28 days, as well as using the shell
> > > scripts one liners as per provided examples.
> > 
> > That's the expected result: It should be 22:00 on the second wednesday
> > and 21:00 in the third wednesday.
> 
> sorry edwing it seems to me that i have missed something here
> but i don't seem to be able to work out what it is that i have
> missed, my brain is telling me that i am supposed to be seeing
> teh 22:00:00 going forward .. i am stuck in a closed loop that
> i cannot break out off, i would appreciate some help please.

Before you should have:

    $ date -r `expr 1206529200` 
    Wed Mar 26 22:00:00 EST 2008
    $ date -r `expr 1206529200 + 86400 \* 7` 
    Wed Apr  2 21:00:00 EST 2008
    $ date -r `expr 1206529200 + 86400 \* 14` 
    Wed Apr  9 21:00:00 EST 2008

22:00 - *21*:00 - 21:00

And afterwards you should have:

    $ date -r `expr 1206529200` 
    Wed Mar 26 22:00:00 EST 2008
    $ date -r `expr 1206529200 + 86400 \* 7` 
    Wed Apr  2 22:00:00 EST 2008
    $ date -r `expr 1206529200 + 86400 \* 14` 
    Wed Apr  9 21:00:00 EST 2008

22:00 - *22*:00 - 21:00

The 21 on 2 April has been changed to 22. That's the expected
behaviour.

Edwin

-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin at mavetju.org    |              Weblog: http://www.mavetju.org/weblog/


More information about the BUGS mailing list