The following piece of code:
TimeZone.getTimeZone("Europe/Athens").inDaylightTime(new Date(200, 8, 14));
returns true, much like it does for the year 2011. However, Daylight Saving Time (DST) was only proposed 100 years or so ago, and applied even more recently. Is the time in the year 200 considered DST, or is this a Java quirk?
You are mistaken. It works as expected when you use the date new Date(-1700, 8, 14) (which is year 200). The constructor you are using is adding 1900 to your year. You are actually using year 2100.
Check the Date constructor api.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With