$post['tzoffset'] = $post['timezoneoffset']; if ($post['dstonoff']) { // DST is on, add an hour $post['tzoffset']++; if (substr($post['tzoffset'], 0, 1) != '-') { // recorrect so that it has + sign, if necessary $post['tzoffset'] = '+' . $post['tzoffset']; } }