[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

php format date

Is there a way in PHP I can format "2011-09-17" to "Saturday, 17 September 2011"?
0
PeterErhard
Asked:
PeterErhard
  • 2
2 Solutions
 
Garry GlendownConsulting and Network/Security SpecialistCommented:
Assuming you start out with a timestamp, this should do the job:

$datestring=date("l, j F Y",$timestamp)

Open in new window


0
 
Chris HarteThaumaturgeCommented:
echo  date('l \t\h\e jS \of F Y g:i:s a', mktime(0, 0, 0, 9, 11, 2011));

Should do it. More examples here

http://uk.php.net/manual/en/function.date.php
0
 
Garry GlendownConsulting and Network/Security SpecialistCommented:
If all you have is the input shown above, you could do this:

$datestring=date("l, j F Y",strtotime($inputdate));

Open in new window

0
 
PeterErhardAuthor Commented:
Thank you both very much.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now