Obtaining client's time zone data

All about creating websites!
Post Reply
User avatar
Demian
forum buddy
forum buddy
Posts: 10
Joined: 28 Nov 2005, 17:00
15

Obtaining client's time zone data

Post by Demian »

It doesn't seem to get transmitted in the browser headers, but somehow it seems to be possible to find out the requesting client's time zone from a server-side program. How could it be done?

User avatar
CommonStray
Forum Assassin
Forum Assassin
Posts: 1214
Joined: 20 Aug 2005, 16:00
15

Post by CommonStray »

request.getLocale() gives you client env. info


use the date object in javascript, and set a hidden value in a form

example
<script>
document.loginform.tzoffset.value = new Date().getTimezoneOffset();
</sript>


but if your creating a website and you want to know the clients(users) timezone just ask it in a form or something

Post Reply