Java Time: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 6: Line 6:


==Raw Time Zone Offset==
==Raw Time Zone Offset==
We can get the amount of milliseconds to apply to UTC to get the standard time in a certain time zone (the standard time offset) with <tt>TimeZone.getRawOffset()</tt>.
This value is not affected by daylight saving time.


<pre>
<pre>

Revision as of 21:59, 13 July 2016

Internal

Time Zone

Raw Time Zone Offset

We can get the amount of milliseconds to apply to UTC to get the standard time in a certain time zone (the standard time offset) with TimeZone.getRawOffset().

This value is not affected by daylight saving time.

TimeZone tz = ...
tz.getRawOffset()

Daylight Saving Time Offset

Figuring Out Whether Daylight Saving is in Effect for a Certain Date

Date d = ...
inDaylightTime(d);