Jump to content

PHP Date Format question


laide234

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???
Link to comment
https://forums.phpfreaks.com/topic/16917-php-date-format-question/
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().

Archived

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

×
×
  • Create New...

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.