News Feed
Sections




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

Ibuildings techPortal:
Tips for Working with DateTime in PHP
May 04, 2010 @ 13:33:29

In the latest post from the Ibuildings techPortal Lorna Mitchell takes a look at one of the more powerful features included in PHP versions 5.2 and greater - the DateTime class.

In the newer PHP 5.3 versions even more excellent functionality was added. This is a short post to introduce this functionality with a focus on the methods available in PHP 5.2 showing some simple examples of how we can more easily manipulate and display dates without needing to work with timestamps.

She shows how to create a simple DateTime object, how to change up the timezone information related to it and has an example of how to output the format with a call to the format function. She also mentions how they can simplify the storage of date information in a database since they can be moved around between timezones easily (instead of having to calculate the different between where it was created and where it's being used).

0 comments voice your opinion now!
datetime tip tutorial example timezone


blog comments powered by Disqus

Similar Posts

Lorna Mitchell's Blog: POSTing JSON Data With PHP cURL

ProDevTips.com: Memcached in PHP on Dapper

Simon Jodet: Partial mocks with Mockery

php|architect: Using PHP5's SOAP Support

ProDevTips.com: Writing a CMS/Community with Smarty and the Zend Framework: Part 9


Community Events

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


introduction interview podcast community php7 example laravel release version library xdebug api series opinion framework performance symfony2 extension voicesoftheelephpant conference

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