Re: Date formatting issue

From: Date: Tue, 05 Aug 2008 15:51:06 +0000
Subject: Re: Date formatting issue
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-277733@lists.php.net to get a copy of this message
On Tue, Aug 5, 2008 at 11:48 AM, Don Don <progwihz@yahoo.com> wrote: > Hi all, > > I've got dates in the following formats e.g. > > August 05, 2008, 10:14 am (e.g. today's date) > August 04, 2008, 7:08 am (e.g. yesterda's date) > August 03, 2008, 9:08 am (e.g. in the past) > > I am trying to format these dates do I can display them like this > > Today at 10:14 am (today) > Yesterday at 9:08 am (yesterday) > August 03, 9:08 am (if its not today or yesterday then display the month > and day and time only) > > Can anyone help with tips on how to achieve this ? > > Cheers > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Check out date() and mktime() -- http://www.php.net/date http://www.php.net/mktime Both of those should get you in the direction of formating dates. -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. "Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life."

« previous php.general (#277733) next »