i Cant SeT timE ZOnE aCcoRding To mE iN http://************ script cAn AnyoNe helP me plz...
http://************ HavE a loOk
Started on the old forum in May 2012 · view the original in the archive · old links redirect here
i Cant SeT timE ZOnE aCcoRding To mE iN http://************ script cAn AnyoNe helP me plz...
http://************ HavE a loOk
heres how i use php to get "my" current time to show instead of the servers time.
/* timezone
Add how many hours and minutes you need
(change the FIRST + symbol after time() ONLY!)
(do not touch the second symbol)
("+" = forward "-" = backwards)
NOTE: ONLY CHANGE THE + SYMBOL IF YOU NEED TO GO BEHIND SERVER TIME */
$hours = "1";
$mins = "";
$timezone = time() + ($hours)*60*60 + ($mins)*60;
$time=date("H:i",$timezone);
then to show the "new" time set. you simple just
echo "$time";
hope this helps solve your problem.
dude thanxx for that bt i tried it...
if u dont mind can u tell me how to chng my servr tym...
dreamer143 wrote: DuDe thanxx For that bt i tried it...
if u dont mind can u tell me how to chng my servr tym...
i dont believe you can change your servers time. you can only change what it displays through php.
the code above i showed you will easily change the servers time..
for example.
if server time is lets say. 15:00 (3pm) and your time is 18:00 (6pm)
you would just change the 1 to a 3 where it says.
$hours = "1";
echo the $time and youll see the time has changed from 15:00 to 18:00
if you wanted to "behind server time" you changed 2 things.
lets say your server time is still 15:00 but your time iss 12:00
you'd change these 2 lines.
change again 1 to 3,
$hours = "1";
but this time you also changed.
$timezone = time() + ($hours)*60*60 + ($mins)*60;
to this, change the "first" + symnol, to a - symbol. like so.
$timezone = time() - ($hours)*60*60 + ($mins)*60;
thats basically how to manipulate the time appearance.
thanxx thanxx sorry for that i m trubling u bt i m new in this coding world and i dont knw much abt it..
dreamer143 wrote: thanxx thanxx sORry for that i m trubling u bt i m nEw iN thIs coding woRld and i dOnt knW much abt iT..
well goodluck. hope what ive showed you you can put to good use 🙂
goodluck,