diff options
author | thomascube <thomas@roundcube.net> | 2008-09-03 16:03:19 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-09-03 16:03:19 +0000 |
commit | c8ae2497b7e4c7393210ed186acd672a0040389f (patch) | |
tree | b21442a9fff2d15cee5809db3d532d8ef378da37 /program/include/main.inc | |
parent | 7003206d64c83534f29d1eb9dfc53edf993baf5b (diff) |
Auto-detect client language and timezone if desired by config/prefs
Diffstat (limited to 'program/include/main.inc')
-rw-r--r-- | program/include/main.inc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 83ed8c02e..469d8441c 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -706,9 +706,13 @@ function format_date($date, $format=NULL) return ''; // get user's timezone - $tz = $CONFIG['timezone']; - if ($CONFIG['dst_active']) - $tz++; + if ($CONFIG['timezone'] == 'auto') + $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : intval(date('O'))/100; + else { + $tz = $CONFIG['timezone']; + if ($CONFIG['dst_active']) + $tz++; + } // convert time to user's timezone $timestamp = $ts - date('Z', $ts) + ($tz * 3600); |