WordPress.org

Make WordPress Core

Changeset 9137


Ignore:
Timestamp:
10/13/2008 10:14:52 PM (13 years ago)
Author:
ryan
Message:

Convert undefined constants to strings. Props jacobsantos. fixes #7651

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r8961 r9137  
    12161216 * @return string The date and time in MySQL DateTime format - Y-m-d H:i:s.
    12171217 */
    1218 function iso8601_to_datetime($date_string, $timezone = USER) {
    1219     if ($timezone == GMT) {
     1218function iso8601_to_datetime($date_string, $timezone = 'user') {
     1219    $timezone = strtolower($timezone);
     1220
     1221    if ($timezone == 'gmt') {
    12201222
    12211223        preg_match('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits);
     
    12321234        return gmdate('Y-m-d H:i:s', $timestamp);
    12331235
    1234     } else if ($timezone == USER) {
     1236    } else if ($timezone == 'user') {
    12351237        return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string);
    12361238    }
Note: See TracChangeset for help on using the changeset viewer.