How to get browser time zone?

Ads
 

How to get browser time zone?

How to get browser Time Zone and browser date using java concept

View Answers

June 17, 2013 at 6:08 PM

hi friend,

There is no HTTP standard that allow the browser to tell the server about the time. So, to get the time zone you may use the following code snippet.

<html>
<head>
<title> Home </title>
<script type="text/javascript">

var userDate = new Date();  
var userTimeZone = ( userDate.getTimezoneOffset()/60 )*( -1 );  

alert("Timezone = " + userTimeZone );
alert("Date : "+userDate); 
</script>
</head>
<body>
<h2>Get TimeZone Example</h2>
</body>
</html>

Thanks.

Ads









Related Tutorials/Questions & Answers:
How to get browser time zone?
how to get browser cookies in java
Advertisements
how to get time picker value in javascript of struts2
get absolute time java
how i get experience wise resume from database when i submit from browser
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p
ModuleNotFoundError: No module named 'zoner'
How send different files to browser at same time ..example(pdf&html) want display in same request using servlet
ModuleNotFoundError: No module named 'get-time'
ModuleNotFoundError: No module named 'get-time'
JDBC: Get current Date and Time Example
ModuleNotFoundError: No module named 'sawyer-get-time'
ModuleNotFoundError: No module named 'zlc-get-time'
MySql Time Interval
how to run a applet from browser
how to print the server time
ModuleNotFoundError: No module named 'blockstack-zones'
how to print the server time
How to get Button Id ?
HOW TO SHOW TIME SERIES
How to compile & get output for JSP
how to get radio value
how to get following output
how to get following output
How to get project path
How to get project path
How to get Java SDK
how to get UIView by tag
How to get the current date in Java?
How to display the current time

Ads