Ticket #17448: 17448.patch
| File 17448.patch, 828 bytes (added by johnjamesjacoby, 2 years ago) |
|---|
-
formatting.php
1588 1588 * 1589 1589 * Requires and returns a date in the Y-m-d H:i:s format. Simply subtracts the 1590 1590 * value of the 'gmt_offset' option. Return format can be overridden using the 1591 * $format parameter. 1591 * $format parameter. 1592 1592 * 1593 1593 * @since 1.2.0 1594 1594 * … … 1600 1600 function get_gmt_from_date($string, $format = 'Y-m-d H:i:s') { 1601 1601 preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); 1602 1602 $tz = get_option('timezone_string'); 1603 date_default_timezone_set( $tz ); 1603 if ( !empty( $tz ) ) 1604 date_default_timezone_set( $tz ); 1604 1605 $datetime = new DateTime( $string ); 1605 1606 $datetime->setTimezone( new DateTimeZone('UTC') ); 1606 1607 $offset = $datetime->getOffset();
