Hi all,
A friendly reminder that a leap second will be added to the clock at the end of 2016. If you do date math at all, you may want to check that your date handling code is ready for it.
For example, versions of DateTime below 1.34 won't handle it correctly:
$ perl -MDateTime -E 'say $DateTime::VERSION' 1.33 $ perl -MDateTime -E ' my $dt = DateTime->new( time_zone => "UTC", year => 2016, month => 12, day => 31, hour => 23, minute => 59, second => 60 ); say $dt->datetime; $dt->add( months => 1 ); say $dt->datetime; ' Invalid second value (60) at -e line 2.
$ perl -MDateTime -E 'say $DateTime::VERSION' 1.39 $ perl -MDateTime -E ' my $dt = DateTime->new( time_zone => "UTC", year => 2016, month => 12, day => 31, hour => 23, minute => 59, second => 60 ); say $dt->datetime; $dt->add( months => 1 ); say $dt->datetime; ' 2016-12-31T23:59:60 2017-02-01T00:00:00
Hope this helps somebody :-)
In reply to Leap second coming up. Check your date handling code by 1nickt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |