Jump to content

getting the time


jimfog

Recommended Posts

Ok, with javascript we can get the time(date object) of the user.But can i get the time of the site the user is visiting, meaning the time of the server the user is visiting which will have different time if it is in a country with a different timezone than his(the user's)?Can the above be done with javascript or i must resort to PHP which is a sever-side tech.I hope i was clear.

Link to comment
Share on other sites

yes, if you want the server time, then you would want to use PHP. You can use javascript to make an AJAX request to a PHP script that itself can get the server time, and then echo it out to be sent back as the responseText.

Link to comment
Share on other sites

yes, if you want the server time, then you would want to use PHP. You can use javascript to make an AJAX request to a PHP script that itself can get the server time, and then echo it out to be sent back as the responseText.
Ok suppose a make an ajax request to the server.Is is necessary that a script resides in the server to get the time/date?What if there is no script?A server which has PHP installed on it can it give time/date info without a script being present?I want to have such info from a site which is not mine(constructed by me).Since the site is not mine it is impossible to install a script there.So, given the above info, CAN IT BE DONE? I hope I was clear.
Link to comment
Share on other sites

obviously there have to stay a script which will evaluate the date or time. otherwise how the server know what you want from it? and without of existance of script where will you point in ajax to retrieve the info?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...