Imad Posted November 12, 2008 Share Posted November 12, 2008 Hi guys, I need some help with dates. I have a comments section I created for my site, I want the date to be converted into some friendly text such as: Posted: Today, Yesterday, 2 Days Ago, 1 Month ago, etc. How about can I do so? Best Regards. Link to comment https://forums.phpfreaks.com/topic/132495-php-date-help/ Share on other sites More sharing options...
genericnumber1 Posted November 12, 2008 Share Posted November 12, 2008 Read alllll about it http://us3.php.net/date As for today, etc, compare the current timestamp to the db one and see if it's in a range for "today" or "yesterday", etc. Link to comment https://forums.phpfreaks.com/topic/132495-php-date-help/#findComment-688939 Share on other sites More sharing options...
flyhoney Posted November 12, 2008 Share Posted November 12, 2008 Converting timestamps to things like '1 hour ago', or 'three days ago' is usually called fuzzy time. Try googling for fuzzy time and you may find a PHP function to help you with this. Link to comment https://forums.phpfreaks.com/topic/132495-php-date-help/#findComment-688947 Share on other sites More sharing options...
Imad Posted November 12, 2008 Author Share Posted November 12, 2008 Thanks for your help guys. Fuzzy time is exactly what I was looking for. Link to comment https://forums.phpfreaks.com/topic/132495-php-date-help/#findComment-688955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.