php report-Strict Standards: mktime(): You should be using the time() function instead
mysql, php
Solution
Calling `mktime()` with no parameters is the same as calling `time()`. The function declaration looks like this:
int mktime ([ int $hour = date("H") [, int $minute = date("i") [, int $second = date("s") [, int $month = date("n") [, int $day = date("j") [, int $year = date("Y") [, int $is_dst = -1 ]]]]]]] )
In other words, using no parameters is the same as using the current date, which is what `time()` does.
$ php -a
Interactive shell
php > echo mktime();
Strict Standards: mktime(): You should be using the time() function instead in php shell code on line 1
1450208188
php > echo time();
1450208189
php >
Nothing has broken because you changed `mktime()` to `time()`. There's something else going on.
Problem
I have a PHP report that is using a date variable to return results from the MySQL database. I did not write the report an it uses `mktime` and I have recently moved to a new server with the latest version of php and i now get This the date variable creation: ``` $start_date = mktime(0,0,0,$StartMonth,$StartDay,$StartYear); $end_date = mktime(23,59,59,$EndMonth,$EndDay,$EndYear); ``` And later to get the date: ``` if ($HTTP_SERVER_VARS['REQUEST_METHOD'] == "POST") { if ($prefix == "Start") { $currYear = $StartYear; $currMonth = $StartMonth; $currDay = $StartDay; } elseif ($prefix == "End") { $currYear = $EndYear; $currMonth = $EndMonth; $currDay = $EndDay; } } else { $arr = getdate(mktime()); $currYear = $arr["year"]; $currMonth = $arr["mon"]; // If the user hasn't chosen a date, // set the beginning day at the first of the month if ($prefix == "Start") $currDay = 01; else $currDay = $arr["mday"]; } ``` When I run the report now I get `Strict Standards: mktime(): You should be using the time() function instead` I have changed it to `$arr = getdate(time());` and it gets rid of the error but now the date picker does not work.