From c8ae2497b7e4c7393210ed186acd672a0040389f Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 3 Sep 2008 16:03:19 +0000 Subject: Auto-detect client language and timezone if desired by config/prefs --- program/include/main.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'program/include/main.inc') 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); -- cgit v1.2.3