News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Phil Sturgeon:
Why PHP DateTime Rocks
August 02, 2012 @ 11:41:29

Phil Sturgeon has a new post sharing some of his thoughts on why DateTime rocks, the advanced functionality that PHP has to work with dates, times, timezones, etc.

DateTime is nothing new, but it's definitely under-used by many. It was made available in PHP 5.2.0 but got some of its best features until PHP 5.3.0. PHP 5.3.0 is pretty old now, but I learned about DateFormat::createFromFormat() after reading a new addition to PHP The Right Way: Date and Time.

He shares to "offender" examples where using this function allowed him to simplify and reduce the amount of code needed to handle the formatting of a date into a MySQL format and calculating the difference between two time values.

0 comments voice your opinion now!
datetime example mysql data format createfromformat


blog comments powered by Disqus

Similar Posts

Scott Johnson\'s Blog: Podcast - How to Learn PHP

PHP Thinktank Blog: PHP-GTK with scottmattocks (IRC Talk Series)

Rob Allen's Blog: Setting up PHP & MySQL on OS X 10.6 Snow Leopard

Imagine Easy: Pushing the limits of metaprogramming in PHP: aspect oriented design

Nick Halstead's Blog: Programming Tips #9 "debug_backtrace"


Community Events

Don't see your event here?
Let us know!


laravel5 security introduction voicesoftheelephpant opinion series unittest community library threedevsandamaybe podcast version language symfony interview release api framework laravel extension

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework