Ignore the decimal part of any floating point argument passed to localtime or gmtime
Rafael Garcia-Suarez [Fri, 13 Mar 2009 12:15:16 +0000 (13:15 +0100)]
That way the overload warning won't be emitted for non-overflowing
floating point values.

pp_sys.c

index fa0c79a..b42cced 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4464,7 +4464,7 @@ PP(pp_gmtime)
           using a double causes an unfortunate loss of accuracy on high numbers.
           What we really need is an SvQV.
        */
-       double input = POPn;
+       double input = Perl_floor(POPn);
        when = (Time64_T)input;
        if (when != input && ckWARN(WARN_OVERFLOW)) {
            Perl_warner(aTHX_ packWARN(WARN_OVERFLOW),