Return to Snippet

Revision: 19585
at October 27, 2009 10:28 by Zwendel


Updated Code
/* $_SESSION['plusDate'] is input in "-1" style*/
$_SESSION['plusDate'] = datumObj::toUnix(
			datumObj::fromUnix( strtotime($_SESSION['plusDays']." days") ) , 
			'23:59:59'
);	

/* based on this class */
class datumObj
{
	public static function toUnix($datum , $uur)
	{ 	
		list($d, $m, $y) = sscanf($datum, "%d/%d/%d");
		return strtotime("$m/$d/$y $uur");		
	}
	
	public static function fromUnix( $timestamp ){
		return date('d/m/Y',$timestamp);
	}
}

Revision: 19584
at October 26, 2009 12:15 by Zwendel


Initial Code
/* $_SESSION['plusDate'] is input in "-1" style
$_SESSION['plusDate'] = datumObj::toUnix(
			datumObj::fromUnix( strtotime($_SESSION['plusDays']." days") ) , 
			'23:59:59'
);	

/* based on this class */
class datumObj
{
	public static function toUnix($datum , $uur)
	{ 	
		list($d, $m, $y) = sscanf($datum, "%d/%d/%d");
		return strtotime("$m/$d/$y $uur");		
	}
	
	public static function fromUnix( $timestamp ){
		return date('d/m/Y',$timestamp);
	}
}

Initial URL

                                

Initial Description

                                

Initial Title
Find end of some day in unix timestamp format

Initial Tags
unix

Initial Language
PHP