Make WordPress Core

Ticket #38940: current_time.patch

File current_time.patch, 910 bytes (added by marco.marsala, 8 years ago)
Line 
1# This patch file was generated by NetBeans IDE
2# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
3# It uses platform neutral UTF-8 encoding.
4# Above lines and this line are ignored by the patching process.
5+++ wp-includes\functions.php
6@@ -59,8 +59,6 @@
7  * @return int|string Integer if $type is 'timestamp', string otherwise.
8  */
9 function current_time( $type, $gmt = 0 ) {
10-        $oldgmt = date_default_timezone_get();
11-        date_default_timezone_set('UTC');
12        switch ( $type ) {
13                case 'mysql':
14                        return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );
15@@ -69,7 +67,6 @@
16                default:
17                        return ( $gmt ) ? date( $type ) : date( $type, time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) );
18        }
19-        date_default_timezone_set($oldgmt);
20 }
21 
22 /**