confucius confucius - 7 months ago 37
Javascript Question

get client time zone from browser

Is there a reliable way to get a timezone from client browser? I saw the following links but I want a more robust solution.

Auto detect a time zone with JavaScript

Timezone detection in JavaScript

Answer

Look at this site pageloom it is helpful

download jstz.min.js and add a function to your html page

    <script language="javascript">
        function getTimezoneName() {
            timezone = jstz.determine()
            return timezone.name();
        }
    </script>

and call this function from your display tag