Jump to content

Archived

This topic is now archived and is closed to further replies.

laide234

PHP Date Format question

Recommended Posts

I am pulling a date from a database entry.  <?php echo $job_date; ?> displays as '2006-08-07 00:00:00'

I would like to format the display. But when I use <?php echo date("F, jS Y", $job_date); ?> I get 'December, 31st 1969' .

This is the format that I want, but where is it getting December from???

Share this post


Link to post
Share on other sites
'December, 31st 1969' is the default date for an invalid timestamp. A recent timestamp should look like: 1155056922. You can't provide the date() function with '2006-08-07 00:00:00'. You need to give it an actual timestamp which can be generated with mktime().

Share this post


Link to post
Share on other sites
[code]echo date("F, jS Y", strtotime($job_date));[code]

Try that...[/code][/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.