date - Calendar java does not work properly -


import java.util.calendar;  ...  calendar calendar = calendar.getinstance(); calendar.settime(new date(1443351600000l));// set 2015-9-27 calendar.add(calendar.hour_of_day, 23); // add 23 hours 

i don't know why calendar updated 2015-09-27 00:00:00 2015-09-28 00:00:00. expect 2015-09-27 23:00:00.

calendar calendar = calendar.getinstance(); calendar.settime(new date(1443351600000l));// set 2015-9-28 calendar.add(calendar.hour_of_day, 23); // add 23 hours 

and 1 works fine. result 2015-09-28 23:00:00.

there's 23 hours in day if daylight saving time starts on 2015-9-27.

google search says following starts daylight saving time on sep 27, 2015:

if you're in 1 of these places, there's answer.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -