dudeness3 Posted December 22, 2006 Share Posted December 22, 2006 I need help on this, its for a forum, specifically FlexBBI want to turn this :[code]Re: Hello~!by chesteron December 21st, 2006, 10:39 PM[/code]Into this:[code]Re: Hello~!by chesterToday, 10:39 PM[/code]can someone help me? Link to comment https://forums.phpfreaks.com/topic/31564-solved-how-to-show-todayyesterday-instead-of-date/ Share on other sites More sharing options...
JasonLewis Posted December 22, 2006 Share Posted December 22, 2006 yerp. easy. :) my way:just make your date variable in the format of date("mdy").[code=php:0]if($date == date("mdy")){$date = "Today"; //add the time bit}elseif($date == date("mdy", mktime(0,0,0,date("m"),date("d")-1,date("y"))){$date = "Yesterday"; //add the time bit as well}else{$date = $date; //default date...}[/code]hope that helps! Link to comment https://forums.phpfreaks.com/topic/31564-solved-how-to-show-todayyesterday-instead-of-date/#findComment-146295 Share on other sites More sharing options...
dudeness3 Posted December 22, 2006 Author Share Posted December 22, 2006 Thanks alot! :) Link to comment https://forums.phpfreaks.com/topic/31564-solved-how-to-show-todayyesterday-instead-of-date/#findComment-146306 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.