Solved

php format date

Posted on 2011-09-17
4
287 Views
Last Modified: 2012-08-13
Is there a way in PHP I can format "2011-09-17" to "Saturday, 17 September 2011"?
0
Comment
Question by:PeterErhard
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Garry-G earned 250 total points
ID: 36553959
Assuming you start out with a timestamp, this should do the job:

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

Open in new window


0
 
LVL 16

Assisted Solution

by:Chris Harte
Chris Harte earned 250 total points
ID: 36553965
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
 
LVL 17

Expert Comment

by:Garry-G
ID: 36553969
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
 

Author Closing Comment

by:PeterErhard
ID: 36553991
Thank you both very much.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
windows 10 bash shell 4 35
Editing login page in zencart. 2 14
PHP loop not working 4 32
mysql left join sentence 7 21
Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now