Apr 07, 2011 — 5 comments
Working with Dates and Times prior to PHP 5.2 meant using date(), strtotime(), and other date related functions sometimes in convoluted ways to get to the date(s) you were looking for. Fortunately with PHP 5.2 the DateTime() class were introduced. (DateTimeZone() was introduced as well but is not covered here). It was further enhanced in PHP with additionally methods as well as the new DatePeriod() and DateInterval() classes.