LightPHPFramework

Date Class

The Date class provides some functions to work with dates.

set_default_timezone($timezone)

This method set the default timezone.

Static Yes
Parameters Parameter Type Default Description
$timezone String String with the server timezone.
Example
		
Date::set_default_timezone('Europe/Berlin');
		
	

get_default_timezone()

This method returns the default timezone.

Static Yes
Parameters Parameter Type Default Description
Example
		
var_dump(Date::get_default_timezone());
//Output : string(13) "Europe/Berlin"
		
	

days_in_month($month, $year = null)

This method return the number of days for given month in the specified year.

Static Yes
Parameters Parameter Type Default Description
$month integer Required The month to use for this method.
$year integer null The year to use for this method. If no year is given, the current year will be used.
Example
		
var_dump(Date::days_in_month(2, 2012));
// Output: (int) 29