Feelay 0 Report post Posted February 14, 2008 Hey!I was wondering..Is it possible to chnage the server time for my website? Or is it the same time for all servers?Thanks //Feelay Share this post Link to post Share on other sites
yordan 10 Report post Posted February 14, 2008 I guess that the server time is the local time for the city where the server is physically located.Of course, like in my forum, the time seen by the user is the user's PC local time. Share this post Link to post Share on other sites
Feelay 0 Report post Posted February 14, 2008 oh? what code can I use to do that (php please:P)? because my site is showing the time like "06:02:19" when it is "15:21" Share this post Link to post Share on other sites
Quatrux 4 Report post Posted February 14, 2008 (edited) if you're using PHP and if the server supports PHP5, you can always set the the timezone and as I know you even can get an error if you're using date functions and didn't set it, here is the function: http://php.net/date_default_timezone_seton PHP4 you couldn't do that, instead it was using the server time, but that was easy to avoid, when you know where the server is or even you don't know, you can just get the server time see at your clock on your hand or in the computer and just add or minus the hours needed, I mean change the GMT to + or - something.. I personally use .htaccess that I wouldn't need to do it in all the PHP stuff everytime, like this: php_value date.timezone "Europe/Vilnius"php_value date.default_latitude 54.7233php_value date.default_longitude 25.2233php_value date.sunrise_zenith 90.833333php_value date.sunset_zenith 90.833333 So you can change whatever you want or the settings you live in, for example this cooridantes are the place I live in ~1km radius Just put the .htaccess file in your root directory, before public_html if you want it to work everywhere.. Edited February 14, 2008 by Quatrux (see edit history) Share this post Link to post Share on other sites
yordan 10 Report post Posted February 14, 2008 By the way, from a semantic point of view as well as from a generalized relativity theory point of view... Doing this you are not changing the Xisto computer server time, you are changing the way the connected users see the system clock. Share this post Link to post Share on other sites
Feelay 0 Report post Posted February 14, 2008 I know But, I have "last login" on my website, and I am going to add a clock. And why would a user in The USA know how much the clock is here in sweden ? Share this post Link to post Share on other sites
yordan 10 Report post Posted February 14, 2008 I think that this is exactly what the Xisto forum precisely does : I see that your previous post is dated five minutes ago, in terms of my local time. And probably, your local time is not mine, and is not Xisto's city time. Share this post Link to post Share on other sites
Feelay 0 Report post Posted February 14, 2008 (edited) Well.. atm, it is 18:25 here, but the forums time is 18:35 xDBut I understand what you mean Edited February 14, 2008 by Feelay (see edit history) Share this post Link to post Share on other sites
Feelay 0 Report post Posted February 15, 2008 (edited) can you help me find a code that will show the localtime on the users pc. can't find any =/ Thanks //Feelay (EDIT: I just realized that i have double posted. didn't see that earlier. I am veryvery sorry for that.) Edited February 15, 2008 by Feelay (see edit history) Share this post Link to post Share on other sites
toby 0 Report post Posted February 16, 2008 now=new Date(); hour=now.getHours(); min=now.getMinutes(); sec=now.getSeconds(); Share this post Link to post Share on other sites