Hi there, my server is based in the use, and the server clock is 5 hours behind my preasent time. How can i make it so the time on my scripts is forward 5 hours??
Printable View
Hi there, my server is based in the use, and the server clock is 5 hours behind my preasent time. How can i make it so the time on my scripts is forward 5 hours??
you could use mktime() and add 5 hours to it. something like
of course you can change the format if you want a different time, like change H to h if you want the time to only goto 12 instead of 23PHP Code:$hr = date("H");
$min = date("i");
$sec = date("s");
$newtime = strftime("%H:%i:%s", mktime($hr+5,$min,$sec,0,0,0));
cheers mate :D
The PHP function gmtime function will always return the date/time in GMT.
During our summer you can add 1 to that, during winter leave the returned value as it is. I tend to just leave it as it is and always put "GMT" after the value so people know.