Home » Java Date getTimezoneOffset() Method with Examples

Java Date getTimezoneOffset() Method with Examples

by Online Tutorials Library

Java Date getTimezoneOffset() Method

The getTimezoneOffset() method of Java Date class returns the offset which is measured in minutes for the local time zone which is relative to UTC, and that is appropriate for the time represented by this date object.

This method is deprecated as of JDK version 1.1 and replaced by Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)/(60*1000)

Syntax:

Parameters

NA

Return

The getTimezoneOffset() method returns the time-zone offset for the current time zone.

Example 1

Test it Now

Output:

Current time-zone offset is : -330  

Next TopicJava Util Date

You may also like