How do i mange Time. - Servers in US (So Server in US Time) - Target Audience in UK & Asia (Both different Time Zone) - I want to show local time when some body enters the site - How do i do it. - Any addional db needs to be integrated. - how this stuff can be coded. Roxy.
2 ways: 1) Use javascript to take the time straight off the users PC 2) Use a geolocation script to find the country from the IP and then adjust the time accordingly.
I can take country from profile section of the site , so IP may not be required in my case but following queries 1) Do any body know DB for Country + GMT Time Database 2) Do you know a smilar java script that does for atleast 15 to 20 countries on on load
With javascript you don't need a country/timezone database. http://javascript.internet.com/page-details/date-time-stamp.html The time is taken from your PC.
do you actually store any time data in your database or do you just want to display a local time to the user? The method I use is: - store the time data on server in GMT - use javascript to get the timezoneoffset in hours (from GMT), ie +1, +8, -4 etc from user - display time = time from database + $offset in secs
I am storing in database i am sure it can not be done by simply pure js , any body have idea of GMT DB
You don't need to do it all in JS. All you need JS to do is to get the offset from GMT. Once you get that, you offset the time stored in your db by the amount you get from your JS code. You don't need any extra db either.