how know the exact day of the timesaving?
i have a server from a diferent country where i have 6 hours +/- of diference
i have this function to return the correct hours
but when the timesaving occor i need change the var "valor"
for 0 or 1 because the timesaving
$hr = date("H:i:s", mktime(gmdate("H")+$valor, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));
my question is there is a better solution for this and/or how can i find the exact day of the hour change? windows can determine the exact day without internet connection so i think there is some calc to check the date.
any one can help me?
Why? Just use date_default_timezone_set($timezone) to set the default timezone, and let PHP handle everything else on it's own?
i will see that function thanks
but i still need know how can i determine the date of the timesaving
will return '1' if it's DST, and '0' otherwise, I assume you can use (int) to cast it back to an integer.
thanks a lot for your help
You know, come to look over your code I don't know why you can't use:
But I'm sure there's a good reason.
$hr = date("H:i:s", strtotime('+6 hours'));
That would only work if both locations always start and finish daylight saving time on the same day. Setting the timezone will still work even when they don't start and end DST on the same day or where only one has DST.
Originally Posted by scragar
Well I suggested that and it got shot down, I was only providing an alternate solution that's more than likely going to work since my first recommendation was rejected.
Originally Posted by felgall
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)