Skip to content

smshuja/DateMath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

DateMath

DateMath is a PHP class which makes date manipulation simple.

Usage


$myDate = new DateMath('2011-01-01'); 		$myDate->addMonths(2)
	   ->addDays(3)
	   ->firstDayOfWeek();
echo $myDate->toString('Y-m-d');	

Methods

  • addSeconds($num)
  • addMinutes($num)
  • addHours($num)
  • addDays($num)
  • addMonths($num)
  • addYears($num)
  • addWeeks($num)
  • firstDayOfWeek()
  • firstDayOfMonth()
  • lastDayOfMonth()
  • lastDayOfWeek()
  • toString($format = 'Y-m-d H:i:s')
  • toGMTString($format = 'Y-m-d H:i:s')
  • getTime()

Releases

No releases published

Packages

No packages published

Languages