Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert 2010-04-16 16:30:00 to "Tomorrow Afternoon"

Convert 2010-04-16 16:30:00 to "Tomorrow Afternoon" or convert another date to "this afternoon", "next year", "next week wednesday". You get the picture. Anyone know of a PHP or Javascript library that can do this?

like image 975
Allan Davies Avatar asked Dec 07 '25 15:12

Allan Davies


1 Answers

I think you can come a long way with what is said here: Calculate relative time in C#
The logic is there, and it's not too hard to do the javascript equivalent if a solution in a different language suits you.

like image 100
npup Avatar answered Dec 10 '25 03:12

npup



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!