| @@ -102,15 +102,19 @@ | ||
| 102 | 102 | $offset = 0; |
| 103 | 103 | if ( isset($match[15]) and $match[15] == 'Z' ) : |
| 104 | 104 | # zulu time, aka GMT |
| 105 | 105 | else : |
| 106 | - $tz_mod = $match[12]; | |
| 107 | - $tz_hour = $match[13]; | |
| 108 | - $tz_min = $match[14]; | |
| 106 | + $tz_mod = (isset($match[12]) ? $match[12] : NULL); | |
| 107 | + $tz_hour = (isset($match[13]) ? $match[13] : NULL); | |
| 108 | + $tz_min = (isset($match[14]) ? $match[14] : NULL); | |
| 109 | 109 | |
| 110 | 110 | # zero out the variables |
| 111 | - if ( ! $tz_hour ) { $tz_hour = 0; } | |
| 112 | - if ( ! $tz_min ) { $tz_min = 0; } | |
| 111 | + if ( is_null($tz_hour) ) : | |
| 112 | + $offset = (int) get_option('gmt_offset'); | |
| 113 | + $tz_hour = abs($offset); | |
| 114 | + $tz_mod = ((abs($offset) != $offset) ? '-' : '+'); | |
| 115 | + endif; | |
| 116 | + if ( is_null($tz_min) ) : $tz_min = 0; endif; | |
| 113 | 117 | |
| 114 | 118 | $offset_secs = (($tz_hour*60)+$tz_min)*60; |
| 115 | 119 | |
| 116 | 120 | # is timezone ahead of GMT? then subtract offset |