News Feed
Sections




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

Brandon Savage's Blog:
Cool DateTime Functions In PHP 5.3
January 25, 2010 @ 10:13:31

Brandon Savage has posted about some interesting things he's come across when working with the DateTime objects in PHP 5.3 including working with timestamps and differences in terms of days/months/etc.

Over time, the PHP DateTime object has become one of the best objects available to PHP developers. This object has grown since early PHP 5 into a robust class that has the ability to do lots of great things. Recently, I was exploring some of the functionality provided by the DateTime object as of PHP 5.3 (and wishing that Ubuntu had PHP 5.3 as a package distribution). Here are some of the new things in PHP 5.3 that are really cool.

He mentions the "add()" and "sub()" methods you can use on an object to get information about the dates/times forward and backwards, the "diff()" to get the differences between two dates and the get/setTimestamp methods to get the current time (or set it).

0 comments voice your opinion now!
datetime function interesting feature


blog comments powered by Disqus

Similar Posts

AnyExample.com: 5 useful PHP functions for MySQL data fetching

Davey Shafik's Blog: Karma-Based Mailing Lists (or: how to automate a meritocracy)

Gonzalo Ayuso's Blog: New features in PHP5.4 alpha1

Nikita Popov: Are PHP developers functophobic?

Martynas Jusevicius' Blog: PHP 5 features: Class autoloading


Community Events





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


list library install laravel framework deployment release tips bugfix podcast community api opinion language voicesoftheelephpant introduction interview package series symfony

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