TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   format date to "10 Jan 2011" (http://www.talkphp.com/absolute-beginners/5674-format-date-10-jan-2011-a.html)

captainmerton 01-08-2011 01:10 PM

format date to "10 Jan 2011"
 
Wondering if there is a php function i can use to take a date and format it to "10 Jan 2011" date format. I know its easy to get todays date like this but can i pass in a unix date or a standard format i.e. 2011-01-10 and get it returned in the format above?

Any help much appreciated. Cheers.

Salathe 01-08-2011 01:33 PM

Look at the date() function (manual), you can pass in a Unix timestamp as the (optional) 2nd argument.

alonewolf 01-08-2011 11:57 PM

You can use , <?=date("d M Y",mktime());?> betic.

captainmerton 01-10-2011 06:38 PM

Salathe - your suggestion worked. Just changed the date to a unixdate then fed it into the date() function with the required format specified. Many Thanks.


All times are GMT. The time now is 05:29 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0