CodeIgniter Forums
Setting the Server Time - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Setting the Server Time (/showthread.php?tid=9227)



Setting the Server Time - El Forum - 06-17-2008

[eluser]Unknown[/eluser]
Hey there-- I'm new with CodeIgniter. Absolutely loving it so far.

But I have a basic PHP question. Is it possible to set the server time in code? I have a Unix timestamp (seconds since 1970) of a remote server and I want to use that to set my server's time for synchronization. The only functions in PHP that I can find appear as though they only change the time of a date_time object, which is not what I want (I think?).

How can I do this (if possible)?

Thanks in advance!


Setting the Server Time - El Forum - 06-19-2008

[eluser]Unknown[/eluser]
(bump)


Setting the Server Time - El Forum - 06-19-2008

[eluser]Nikhil Vijayan[/eluser]
the only way i know to change the time to a timezone of our wish in php is

Code:
date_default_timezone_set('Asia/calcuta')

and it works only in php 5