Javatpoint Logo
Javatpoint Logo

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





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA