diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 31c8b22f89..523451d89a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -49,14 +49,16 @@ function mysql2date($dateformatstring, $mysqlstring, $use_b2configmonthsdays = 1 return $j; } -function current_time($type) { +function current_time($type, $gmt = 0) { $time_difference = get_settings('time_difference'); switch ($type) { case 'mysql': - return gmdate('Y-m-d H:i:s'); + return ($gmt) ? gmdate('Y-m-d H:i:s') + : gmdate('Y-m-d H:i:s', (time() + ($time_difference * 3600)));; break; case 'timestamp': - return time(); + return ($gmt) ? time() + : time() + ($time_difference * 3600); break; } } @@ -457,13 +459,13 @@ function touch_time($edit = 1) { echo '

?
'; $time_adj = time() + ($time_difference * 3600); - $post_date_localtime = get_date_from_gmt($postdata['Date']); - $jj = ($edit) ? mysql2date('d', $post_date_localtime) : date('d', $time_adj); - $mm = ($edit) ? mysql2date('m', $post_date_localtime) : date('m', $time_adj); - $aa = ($edit) ? mysql2date('Y', $post_date_localtime) : date('Y', $time_adj); - $hh = ($edit) ? mysql2date('H', $post_date_localtime) : date('H', $time_adj); - $mn = ($edit) ? mysql2date('i', $post_date_localtime) : date('i', $time_adj); - $ss = ($edit) ? mysql2date('s', $post_date_localtime) : date('s', $time_adj); + $post_date = $postdata['Date']; + $jj = ($edit) ? mysql2date('d', $post_date) : gmdate('d', $time_adj); + $mm = ($edit) ? mysql2date('m', $post_date) : gmdate('m', $time_adj); + $aa = ($edit) ? mysql2date('Y', $post_date) : gmdate('Y', $time_adj); + $hh = ($edit) ? mysql2date('H', $post_date) : gmdate('H', $time_adj); + $mn = ($edit) ? mysql2date('i', $post_date) : gmdate('i', $time_adj); + $ss = ($edit) ? mysql2date('s', $post_date) : gmdate('s', $time_adj); echo ''."\n"; echo "