PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

James Cohen's Blog: Working with Date and Time in PHP

Note: This article was originally published at PHPDeveloper on 17 April 7563.
PHPDeveloper

James Cohen has a new post to his blog today looking at some of the built-in functionality that PHP has to work with dates and times including simple things like strtotime and the DateTime feature.

A lot of people ask questions relating to date and time in PHP. Here are some answers to the most commonly asked questions and common mistakes.

He covers the differences between working with dates in strtotime, worrying about timezone settings and compares the strtotime/DateTime methods for formatting and returning dates, modifying dates, converting between timezones as well as finding the difference between two timezones.