I am formatting a Date on PHP using the following code:
$date = "2014-11-01";
$date_formatted = gmdate("Y-m-d", strtotime($date));
When I print them, the formatted date goes a day back. I was quite surprised. I am not simply looking for a solution (there are many for simple stuff like this). I would like to know how that happened.
echo $date . " ---> " . $date_formatted;
//Displays: 2014-11-01 ---> 2014-10-31