CodeIgniter Forums
error in mysql_to_unix - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: error in mysql_to_unix (/showthread.php?tid=66996)



error in mysql_to_unix - astrolac - 12-30-2016

Hi, there!
I had an error in mysql_to_unix

Message: mktime() expects parameter 1 to be integer, string given
Filename: helpers/date_helper.php
Line Number: 397


I found that line in a system/helpers/date_helper.php
The problem in this code

Code:
        return mktime(
            substr($time, 8, 2),
            substr($time, 10, 2),
            substr($time, 12, 2),
            substr($time, 4, 2),
            substr($time, 6, 2),
            substr($time, 0, 4)
        );
After included all substr in intval the error is gone.
I use the 3.0.6 version, but 3.1.2 have the same problem.