Get Last Day Of The Previous Month
$date = "2010-12-31";
list($yr,$mn,$dt) = split('-', $date); // separate year, month and date
$time_stamp = mktime(0, 0, 0, $mn, 0, $yr); // Create time stamp
$last_month_last_day = date("Y-m-t", $time_stamp);
echo "last_month : " . $last_month";
ouptut : 2010-11-30...
No comments:
Post a Comment