|
|
|
|
![]() ![]() |
Feb 14 2008, 01:22 PM
Post
#1
|
|
|
Kinda N00B Group: Members Posts: 219 Joined: 13-January 08 From: Sweden Member No.: 27,579 |
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 |
|
|
|
Feb 14 2008, 02:25 PM
Post
#2
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 1,980 Joined: 16-August 05 Member No.: 7,896 |
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. |
|
|
|
Feb 14 2008, 02:31 PM
Post
#3
|
|
|
Kinda N00B Group: Members Posts: 219 Joined: 13-January 08 From: Sweden Member No.: 27,579 |
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"
|
|
|
|
Feb 14 2008, 02:34 PM
Post
#4
|
|
|
the Q Group: [HOSTED] Posts: 1,022 Joined: 13-July 05 From: Lithuania, Vilnius Member No.: 7,059 |
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://www.php.net/date_default_timezone_set
on 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: CODE php_value date.timezone "Europe/Vilnius" php_value date.default_latitude 54.7233 php_value date.default_longitude 25.2233 php_value date.sunrise_zenith 90.833333 php_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.. This post has been edited by Quatrux: Feb 14 2008, 03:05 PM |
|
|
|
Feb 14 2008, 04:28 PM
Post
#5
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 1,980 Joined: 16-August 05 Member No.: 7,896 |
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 astahost computer server time, you are changing the way the connected users see the system clock. |
|
|
|
Feb 14 2008, 04:35 PM
Post
#6
|
|
|
Kinda N00B Group: Members Posts: 219 Joined: 13-January 08 From: Sweden Member No.: 27,579 |
I know
|
|
|
|
Feb 14 2008, 05:03 PM
Post
#7
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 1,980 Joined: 16-August 05 Member No.: 7,896 |
I think that this is exactly what the astahost 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 astahost's city time.
|
|
|
|
Feb 14 2008, 05:35 PM
Post
#8
|
|
|
Kinda N00B Group: Members Posts: 219 Joined: 13-January 08 From: Sweden Member No.: 27,579 |
Well.. atm, it is 18:25 here, but the forums time is 18:35 xD
But I understand what you mean This post has been edited by Feelay: Feb 14 2008, 05:35 PM |
|
|
|
Feb 15 2008, 12:45 PM
Post
#9
|
|
|
Kinda N00B Group: Members Posts: 219 Joined: 13-January 08 From: Sweden Member No.: 27,579 |
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.) This post has been edited by Feelay: Feb 15 2008, 01:24 PM |
|
|
|
Feb 16 2008, 10:52 AM
Post
#10
|
|
|
Premium Member Group: Members Posts: 488 Joined: 29-September 06 Member No.: 16,228 |
CODE now=new Date();
hour=now.getHours(); min=now.getMinutes(); sec=now.getSeconds(); |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th September 2008 - 02:30 AM |