I've got dates stored in a mysql database. The field is of type date
so the value is something like: "2010-09-29" I'm wanting to display
them as in U.S. dates as in month, day, year. I had a function that
did this, now it is not working and I am perplexed as to why. Here's
my echo statement:

<?php echo sqlDateFormat($row['date']); ?>

The $row['date'] is coming out of the mysql database. Here's the
sqlDateFormat function:

function sqlDateFormat($value) {
$date = $value;
$date = strtotime($date);
$date = date('m-d-y', $date);
return $date;

I'd appreciate any suggestions as to why this isn't working.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to