ussher
asked on
Timestamp from 2 years ago as x Days x Weeks x Months x Years ago
How can i take a timestamp from say, 2 years ago and have the output as:
2 years 3 months 2 weeks and 3 days.
it is in answer to the question "How long have i been Representing this person?":
"you have represented them for........: 2 years 3 months 2 weeks and 3 days.
Using PHP
2 years 3 months 2 weeks and 3 days.
it is in answer to the question "How long have i been Representing this person?":
"you have represented them for........: 2 years 3 months 2 weeks and 3 days.
Using PHP
function _represented_for($timestamp){
(what goes here??)
return "2 years, 3 months, 2 weeks and 3 days.";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hey, Thanks Xemorph. Yep that would have done fine too. Got it working now. If i ever refer back to this it will be good to have your example here for reference as well.
Thanks very much
Thanks very much
Open in new window