TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-08-2011, 01:10 PM   #1 (permalink)
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 178
Thanks: 9
captainmerton is on a distinguished road
Default 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.
captainmerton is offline  
Reply With Quote
Old 01-08-2011, 01:33 PM   #2 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Look at the date() function (manual), you can pass in a Unix timestamp as the (optional) 2nd argument.
Salathe is offline  
Reply With Quote
Old 01-08-2011, 11:57 PM   #3 (permalink)
The Wanderer
 
Join Date: Jan 2011
Posts: 5
Thanks: 1
alonewolf is on a distinguished road
Default

You can use , <?=date("d M Y",mktime());?> betic.
alonewolf is offline  
Reply With Quote
Old 01-10-2011, 06:38 PM   #4 (permalink)
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 178
Thanks: 9
captainmerton is on a distinguished road
Default

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.
captainmerton is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to covert the date into dd-mon-yyyy format? sandhyagupta Absolute Beginners 1 07-07-2009 01:37 PM
PHP Access Date problems. mtsang Absolute Beginners 4 06-27-2009 04:59 PM
help me figure out this date thing sarmenhb Absolute Beginners 5 09-15-2008 04:20 PM
Need more ideas for date and time class Wildhoney General 2 01-18-2008 02:22 PM
converting to mysql date format harryhood Absolute Beginners 1 08-21-2005 03:57 AM


All times are GMT. The time now is 08:34 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design