Month Displaying Earlier Than Expected I have the following code to print last month once a new month starts.

$prevmonth = date('F Y', strtotime("last month"));
print $prevmonth;

The problem I encountered recently was that last month was printed before this month (August) begins.  E.g. July was showing although it was still July 31.

Any help on this issue is greatly appreciated.
What about the timezone settings ? This could be a lead.
http://php.net/manual/en/function.strtotime.php