laide234 Posted August 8, 2006 Share Posted August 8, 2006 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??? Quote Link to comment Share on other sites More sharing options...
logged_with_bugmenot Posted August 8, 2006 Share Posted August 8, 2006 '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(). Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 8, 2006 Share Posted August 8, 2006 [code]echo date("F, jS Y", strtotime($job_date));[code]Try that...[/code][/code] Quote Link to comment Share on other sites More sharing options...
laide234 Posted August 8, 2006 Author Share Posted August 8, 2006 You, sir, are a godsend! ;DThanks Daniel0. It worked perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.