We don't bite newbies here... much | |
PerlMonks |
Re^2: Leap second coming up. Check your date handling code (reality)by 1nickt (Canon) |
on Dec 27, 2016 at 21:54 UTC ( [id://1178534]=note: print w/replies, xml ) | Need Help?? |
Well, hold on there a second, tye, that code is demonstration code, taken, as a matter of fact, from the DateTime docs, and only intended to show whether a library is broken or not. You're quite right that it's unlikely you'd pass a value of 60 for seconds as part of a time string. (However, you might be given it as part of one, if you are reading UTC.) The rather obvious way you would get bitten is when your program checks to see whether the next second after the current second is a new day. If your date handling code isn't up to, um, date, your program will tell you that it's January 1, 2017, one second before it really is, because it doesn't know to wait a sec.
Hope this helps!
The way forward always starts with a minimal test.
In Section
Meditations
|
|