Login
Register
All class groups
Latest entries
Top 10 charts
Blog
Forums
Shop
Help
Login
Register
Kind of ridiculous
Search
All class groups
Latest entries
Top 10 charts
Blog
Forums
Shop
Help
Recommend
this page to a friend!
PHP Time Difference
>
All threads
>
Kind of ridiculous
>
(Un) Subscribe thread alerts
Subject:
Kind of ridiculous
Summary:
PHP has built-in classes for this
Messages:
3
Author:
Michael Richey
Date:
2013-05-18 17:48:04
Update:
2013-05-25 16:02:33
1. Kind of ridiculous
Reply
Report abuse
Michael Richey - 2013-05-18 17:48:04
$now = new DateTime('now');
$birthday = new DateTime('1/21/1974'); // any date/time format PHP supports
$interval = $birthday->diff($now);
echo $interval->format('%y years, %m months, %d days');
2. Re: Kind of ridiculous
Reply
Report abuse
Andrzej Krokos - 2013-05-19 18:19:56 -
In reply to
message 1
from Michael Richey
in the new version - yes, but in older ...
3. Re: Kind of ridiculous
Reply
Report abuse
Michael Richey - 2013-05-25 16:02:33 -
In reply to
message 2
from Andrzej Krokos
You listed this class as being for PHP 5, which ships with DateTime and DateTimeInterval ...
About us
Advertise on this site
Site map
Newsletter
Statistics
Site tips
Privacy policy
Contact
Copyright (c)
Icontem
1999-2024
For more information send a message to
info at phpclasses dot org
.
image/svg+xml
image/svg+xml
Contact us using Messenger