Clone
1
get previous date (MY_date_helper.php)
intsurfer edited this page 2012-07-15 10:49:34 -07:00
/**
 * Get previous date for mysql format date
 * by Nick Gorbunov
 *
 * @access    public
 * @param    string '2012-07-25'
 * @return    string '2012-07-24'
 */ 
 if (!function_exists('getPrevDate')) {
function getPrevDate($dat) {
	date_default_timezone_set('Europe/Moscow');
	list($yyyy, $mm, $dd) = explode("-", $dat);
	$d = mktime(0, 0, 0, $mm, $dd, $yyyy) - 24 * 60 * 60;
	list($dd, $tt) = explode(" ", unix_to_human($d, TRUE, 'eu'));
	return $dd;
}

}