...

View Full Version : A non well formed numeric value encountered



cngrock
09-22-2009, 06:15 PM
When giving this:

<?php echo date('jS F Y',$row_rsTrips['date']); ?>

it outputs:

A non well formed numeric value encountered in C:\wamp\www\admin\table_output.php on line 54

1st January 1970

The field type for the date value is set to "DATE" in the mysql database, what am I missing

Thanks in advance

PappaJohn
09-22-2009, 06:18 PM
The date() function expects a timestamp (integer) not a Date as the second parameter.

Phil Jackson
09-22-2009, 06:33 PM
try


echo date("jS F Y", strtotime($row_rsTrips["date"]));


TEST:
echo date("jS F Y", strtotime("01/01/1970"))."<br />";
echo date("jS F Y", strtotime("1st Jan 1970"))."<br />";
echo date("jS F Y", strtotime("01 January 1970"));


All would output "1st January 1970"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum