FW: timelocal() discrepancy vs DateTime->epoch

2017-03-15 Thread Lu Feng
I noticed that the UNIX time from timelocal() started to differ from that you get from using DateTime module, for dates earlier than 11/6/1910. For the America/New_York local timezone, timelocal() thinks there was a DST switch on 11/6/1910, while DateTime module thinks there was none. If you

small DateTime optimization

2017-03-15 Thread Flavio S. Glock
We've been using this patch at work for years, and I just forgot to contribute it back. I hope you find it worth applying. I believe the typical use case was: my $dt = $param || DateTime->now(); In this case $param is used in boolean context, which makes a fallback call to _stringify(). With