Java TimeZone getOffset() MethodThe getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds) method of TimeZone class is used to get the offset of time zone, and the current date. This offset is used to get the local time. SyntaxThis method is overloaded in the following ways. ParametersEra - it is the given date era. Year - it is the given date year. Month - it is the given date month Day - it is the given date of the day-in-month. DayOfWeek - it is the given date of the day-of-week. Milliseconds - it is the milliseconds in the day. Date: It is the date specified as the long type of which, the offset will be returned. ReturnsIt returns the offset in milliseconds. Example 1Output: Offset value :3600000 Example 2Output: Offset value :0 Example 3Output: Offset value :50400000 Example 4Output: Offset value :-39600000 Example 5Output: Offset value :10800000 Example 6Output: Offset value :-39600000 Next TopicJava-timezone-getrawoffset-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India