Welcome Guest, Not a member yet? Register   Sign In
timezone help
#7

[eluser]UnknownPlayer[/eluser]
I tried like this, but not showing correct time..
btw i tried this on my localhost, and i am in Serbia.
Code:
date_default_timezone_set('America/New_York');
// time() will return new york time, i will use this to store every time and date in db  
$time = now();
$timezone = 'UP1'; // serbia timezone utc + 1
$daylight_saving = TRUE;  
$local_time = unix_to_human(gmt_to_local($time, $timezone, $daylight_saving));  
echo $local_time;

I just set on $config['time_reference'] = 'gmt'.

Now it shows me 1 hour more than it should be..

What is problem ?

EDIT:
I removed daylight saving from gmt_to_local and it works, should it be ok like that ?

Now i will store users time zone at some variable and use it like this.. i think that is the way..


Messages In This Thread
timezone help - by El Forum - 02-06-2012, 04:14 PM
timezone help - by El Forum - 02-06-2012, 05:04 PM
timezone help - by El Forum - 02-06-2012, 05:08 PM
timezone help - by El Forum - 02-06-2012, 06:45 PM
timezone help - by El Forum - 02-06-2012, 07:13 PM
timezone help - by El Forum - 02-06-2012, 08:15 PM
timezone help - by El Forum - 02-06-2012, 08:24 PM
timezone help - by El Forum - 02-06-2012, 10:01 PM
timezone help - by El Forum - 02-07-2012, 10:18 AM
timezone help - by El Forum - 02-07-2012, 10:29 AM
timezone help - by El Forum - 02-07-2012, 10:34 AM
timezone help - by El Forum - 02-13-2012, 10:29 AM
timezone help - by El Forum - 02-13-2012, 02:06 PM
timezone help - by El Forum - 02-13-2012, 03:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB