Connecting Tech Pros Worldwide Help | Site Map

How can I get client's local time and date

Newbie
 
Join Date: Nov 2009
Posts: 3
#1: 2 Weeks Ago
How can I get client's local time and date by identifying their Time Zone.

How can I find out their ISP's DAte and time ?

Thanks

Sahkav
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 913
#2: 2 Weeks Ago

re: How can I get client's local time and date


PHP, being server side, is only able to display server time as by the time it is on the clients computer, it's out of PHP's hands. What you will need is javascript and have a look at the Date() function which will do the clients local time.

I am not sure about ISP and I'm not sure you can do that, but I will wait for another expert to confirm that.
Newbie
 
Join Date: Nov 2009
Posts: 3
#3: 2 Weeks Ago

re: How can I get client's local time and date


Thank You.

I strongly believe that we can find out ther internet Service Provider of our client, and then we can dislay their time. Or else we can identify the TimeZone of client and then display their time. I have tried several methods by now. However, the correct codes are yet to come.

anyways,

thanks once again.

Sahkav
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#4: 2 Weeks Ago

re: How can I get client's local time and date


Quote:

Originally Posted by sahkav View Post

Or else we can identify the TimeZone of client and then display their time.

there are several useful methods in JavaScript’s Date object (e.g. Date.getTimezoneOffset(), Date.toLocaleString())
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 913
#5: 2 Weeks Ago

re: How can I get client's local time and date


Quote:

Originally Posted by sahkav View Post

Thank You.

I strongly believe that we can find out ther internet Service Provider of our client, and then we can dislay their time. Or else we can identify the TimeZone of client and then display their time. I have tried several methods by now. However, the correct codes are yet to come.

anyways,

thanks once again.

Sahkav

I am still doubtful about PHP being able to find the ISP's time. ISP's time is not necessarily the same as the users, although it is likely. But yes, Dormi's functions will get you the offset from GMT.
Reply

Tags
date, isps time and date, time, time zone