News Feed
Jobs Feed
Sections




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

Developer Tutorials Blog:
Calculating date difference more precisely in PHP
March 11, 2008 @ 08:40:00

Hasin Hayder has posted his own response to a recent "relative time" article (showing users things like "received 2 days and 3 hours ago") with a more precise method for doing something similar:

This function is production ready and you can use it in any of your application which mainly works with these date difference. I have found it somewhere in web, just forgot the source. Thanks to the unknown author of this excellent function.

The rest of the post is the function itself that takes in the interval string (formatting), the start date, end date and whether to use timestamps or not.

0 comments voice your opinion now!
date calculate precise difference timestamp function


blog comments powered by Disqus

Similar Posts

Lorna Mitchell's Blog: Proof that PHP 5.4 is Twice as Fast as PHP 5.3

Adam Hosker's Blog: Differences Between PHP 4 and 5

Jani Hartikainen's Blog: Should a failed function return a value or throw an exception?

Matthew Weir O'Phinney's Blog: exuberant ctags with PHP in Vim

Jani Hartikainen's Blog: Closures coming in PHP 5.3 and thatís a Good Thing


Community Events











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


hack security release symfony2 introduction unittest component install facebook framework podcast package performance application composer language hhvm project example database

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