Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Change Server Time?
Feelay
post Feb 14 2008, 01:22 PM
Post #1


Kinda N00B
Group Icon

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

Go to the top of the page
 
+Quote Post
yordan
post Feb 14 2008, 02:25 PM
Post #2


Way Out Of Control - You need a life :)
Group Icon

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.
Go to the top of the page
 
+Quote Post
Feelay
post Feb 14 2008, 02:31 PM
Post #3


Kinda N00B
Group Icon

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"
Go to the top of the page
 
+Quote Post
Quatrux
post Feb 14 2008, 02:34 PM
Post #4


the Q
Group Icon

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.. smile.gif

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 biggrin.gif

Just put the .htaccess file in your root directory, before public_html if you want it to work everywhere.. smile.gif

This post has been edited by Quatrux: Feb 14 2008, 03:05 PM
Go to the top of the page
 
+Quote Post
yordan
post Feb 14 2008, 04:28 PM
Post #5


Way Out Of Control - You need a life :)
Group Icon

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... dry.gif
Doing this you are not changing the astahost computer server time, you are changing the way the connected users see the system clock.
Go to the top of the page
 
+Quote Post
Feelay
post Feb 14 2008, 04:35 PM
Post #6


Kinda N00B
Group Icon

Group: Members
Posts: 219
Joined: 13-January 08
From: Sweden
Member No.: 27,579



I know tongue.gif 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 tongue.gif?
Go to the top of the page
 
+Quote Post
yordan
post Feb 14 2008, 05:03 PM
Post #7


Way Out Of Control - You need a life :)
Group Icon

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.
Go to the top of the page
 
+Quote Post
Feelay
post Feb 14 2008, 05:35 PM
Post #8


Kinda N00B
Group Icon

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 tongue.gif

This post has been edited by Feelay: Feb 14 2008, 05:35 PM
Go to the top of the page
 
+Quote Post
Feelay
post Feb 15 2008, 12:45 PM
Post #9


Kinda N00B
Group Icon

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
Go to the top of the page
 
+Quote Post
toby
post Feb 16 2008, 10:52 AM
Post #10


Premium Member
Group Icon

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();
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Panda Server Failure(3)
  2. My Account?(4)
  3. Is The Server Down Or Is It My Account ?(8)
  4. How I Can Connect To Server(4)
  5. Http On Gamma Server Down!(1)
  6. Extracting Archive (zip, Gzip, Rar, Etc..) On Web Server!(3)
  7. Is This A Forum Or Hosting Server?(1)
  8. Problems With Gamma Server(2)
  9. Secure Server Hosting?(2)
  10. Connection To Ftp Server Resetting(5)
  11. Server Won't Connect To Radio(5)
  12. #2002 - The Server Is Not Responding (or The Local Mysql Server's Socket Is Not Correctly Configured) ?(0)
  13. Server Load(2)


 



- Lo-Fi Version Time is now: 7th September 2008 - 02:30 AM