diff options
-rw-r--r-- | include/category_default.inc.php | 4 | ||||
-rw-r--r-- | include/functions.inc.php | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/include/category_default.inc.php b/include/category_default.inc.php index 02f8afd39..d3359b3d4 100644 --- a/include/category_default.inc.php +++ b/include/category_default.inc.php @@ -117,7 +117,7 @@ foreach ($pictures as $row) 'FILE_PATH' => $row['path'], 'FILE_POSTED' => format_date($row['date_available'], 'mysql_datetime'), 'FILE_CREATED' => (empty($row['date_creation'])) ? - '-': format_date($row['date_creation'], 'us'), + '-': format_date($row['date_creation'], 'mysql_date'), 'FILE_DESC' => (empty($row['comment'])) ? '-' : $row['comment'], 'FILE_AUTHOR' => (empty($row['author'])) ? '-' : $row['author'], 'FILE_HIT' => $row['hit'], @@ -125,7 +125,7 @@ foreach ($pictures as $row) 'FILE_WIDTH' => (empty($row['width'])) ? '-' : $row['width'], 'FILE_HEIGHT' => (empty($row['height'])) ? '-' : $row['height'], 'FILE_METADATE' => (empty($row['date_metadata_update'])) ? - '-': format_date($row['date_metadata_update'], 'us'), + '-': format_date($row['date_metadata_update'], 'mysql_date'), 'FILE_RATE' => (empty($row['rate'])) ? '-' : $row['rate'], 'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ? true:false, /* lack of include/functions_picture.inc.php */ diff --git a/include/functions.inc.php b/include/functions.inc.php index efdc79780..093f207e9 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -601,6 +601,14 @@ function format_date($date, $type = 'us', $show_time = false) array($out[1],$out[2],$out[3],$out[4],$out[5],$out[6]); break; } + case 'mysql_date' : + { + preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', + $date, $out); + list($year,$month,$day) = + array($out[1],$out[2],$out[3]); + break; + } } $formated_date = ''; // before 1970, Microsoft Windows can't mktime |