From fda09f5124b9d43b79719e22da89640343f5e3bd Mon Sep 17 00:00:00 2001
From: nacin <nacin@1a063a9b-81f0-0310-95a4-ce76da25c4cd>
Date: Sun, 29 Jan 2012 20:04:11 +0000
Subject: [PATCH] Allow translators to specify a default timezone string OR GMT
 offset. Stop doing date('Z')/3600 math for default gmt_offset, as since WP
 2.9, we set server time to UTC. Server time is unreliable, so no workarounds
 for now. fixes #19601.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
 wp-admin/includes/schema.php | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php
index b0d7b2d8ad..c5b7be694b 100644
--- a/wp-admin/includes/schema.php
+++ b/wp-admin/includes/schema.php
@@ -352,6 +352,18 @@ function populate_options() {
 		}
 	}
 
+	$timezone_string = '';
+	$gmt_offset = 0;
+	/* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
+	   or a valid timezone string (America/New_York). See http://us3.php.net/manual/en/timezones.php
+	   for all timezone strings supported by PHP.
+	*/
+	$offset_or_tz = __( '0', 'default GMT offset or timezone string' );
+	if ( is_numeric( $offset_or_tz ) )
+		$gmt_offset = $offset_or_tz;
+	elseif ( $offset_or_tz && in_array( $offset_or_tz, timezone_identifiers_list() ) )
+			$timezone_string = $offset_or_tz;
+
 	$options = array(
 	'siteurl' => $guessurl,
 	'blogname' => __('My Site'),
@@ -399,7 +411,7 @@ function populate_options() {
 	'ping_sites' => 'http://rpc.pingomatic.com/',
 	'advanced_edit' => 0,
 	'comment_max_links' => 2,
-	'gmt_offset' => date('Z') / 3600,
+	'gmt_offset' => $gmt_offset,
 
 	// 1.5
 	'default_email_category' => 1,
@@ -465,7 +477,7 @@ function populate_options() {
 	'widget_rss' => array(),
 
 	// 2.8
-	'timezone_string' => '',
+	'timezone_string' => $timezone_string,
 
 	// 2.9
 	'embed_autourls' => 1,