I have a little problem with timestamp. When i try to get current date with
$datestring = date("Y-m-d");
I get the correct date as 2012-11-14.
But with this little script
$timestamp = mktime(0, 0, 0, date("Y"), date("m"), date("d"));
echo $timestamp . "<br />";
echo gmdate("Y-m-d", $timestamp);
I get 2182-08-10 at the end. Any ideas?
Followup Question
With
$timestamp = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
echo $timestamp . "<br />";
echo gmdate("Y-m-d", $timestamp);
I now get 2012-11-13. Why is that?
The function signature is:
The order is hour, minute, second, month, day, year, not year, month, day.
Yay American conventions (?).