News Feed
Sections




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

Squirrel Hacker Blog:
PHP DateTime is missing methods in 5.2
April 05, 2010 @ 13:58:26

As SeanJA points out in a new post to his blog, there's two functions that were included in the PHP 5.3 version of the DateTime object in PHp that weren't in the PHP 5.2 version - specifically the get/setTimestamp ones.

These are some strange methods to be missing as a lot of people in the PHP world seem to work on Timestamps using these concepts, so you would have thought that php would have included these methods initially. Unfortunately they did not, so here is a fix for that.

He provides two pieces of code, one to replace the setTimestamp function and the other for the getTimestamp to add in this handy functionality as you might need it.

0 comments voice your opinion now!
datetime method missing settimestamp gettimestamp


blog comments powered by Disqus

Similar Posts

Leszek Stachowski's Blog: php anachronic coding standards

David Goodwin's Blog: PHP DateTime vs mktime / strtotime in Propel

Wez Furlong\'s Blog: Calling SQLBindParameter and avoiding a datetime overflow.

Christian Schaefer's Blog: Beware of the timezone! Working with PHP DateTime & Doctrine for MongoDB

Martynas Jusevicius' Blog: Method overloading in PHP 5


Community Events

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


podcast unittest opinion laravel5 interview laravel voicesoftheelephpant framework introduction api feature language library community development extension release wordpress threedevsandamaybe series

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