summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/main.inc
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-25 20:09:36 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-25 20:09:36 +0000
commit745ef3df6e874e2c11ba1e5b3a7bf13bc129ed0f (patch)
tree13e0f09e763901178b2a1501e952b4a9c20911fd /roundcubemail/program/include/main.inc
parentb37de6243f71dd669f799d2b835cb50c67c42da8 (diff)
Move timezone computation to rcube_config; don't override SESSION['timezone'] when saving prefs
git-svn-id: https://svn.roundcube.net/trunk@5132 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/main.inc')
-rw-r--r--roundcubemail/program/include/main.inc21
1 files changed, 4 insertions, 17 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc
index 0401fe2c1..edd74f860 100644
--- a/roundcubemail/program/include/main.inc
+++ b/roundcubemail/program/include/main.inc
@@ -1021,7 +1021,7 @@ function rcube_strtotime($date)
*/
function format_date($date, $format=NULL)
{
- global $CONFIG;
+ global $RCMAIL, $CONFIG;
$ts = NULL;
@@ -1032,13 +1032,7 @@ function format_date($date, $format=NULL)
return '';
// get user's timezone
- if ($CONFIG['timezone'] === 'auto')
- $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;
- else {
- $tz = $CONFIG['timezone'];
- if ($CONFIG['dst_active'])
- $tz++;
- }
+ $tz = $RCMAIL->config->get_timezone();
// convert time to user's timezone
$timestamp = $ts - date('Z', $ts) + ($tz * 3600);
@@ -1823,17 +1817,10 @@ function rcmail_gen_message_id()
// Returns RFC2822 formatted current date in user's timezone
function rcmail_user_date()
{
- global $CONFIG;
+ global $RCMAIL, $CONFIG;
// get user's timezone
- if ($CONFIG['timezone'] === 'auto') {
- $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;
- }
- else {
- $tz = $CONFIG['timezone'];
- if ($CONFIG['dst_active'])
- $tz++;
- }
+ $tz = $RCMAIL->config->get_timezone();
$date = time() + $tz * 60 * 60;
$date = gmdate('r', $date);