java - Timezone and SimpleDateFormat strange behavior -
if execute code:
string info = "08/02/1941"; simpledateformat dateformat = new simpledateformat("dd/mm/yyyy"); date date = dateformat.parse(data);
i have in output date: sat feb 08 01:00:00 cest 1941
instead if execute code:
string info = "08/02/1971"; simpledateformat dateformat = new simpledateformat("dd/mm/yyyy"); date date = dateformat.parse(data);
the date is: sat feb 08 01:00:00 cet 1971
.
why have difference (cet , cest)?
my timezone europe/berlin (utc+1) , i'm using java 1.7.0_67-b01
war time — shifting time zones
daylight saving time observed year long in 1941 in berlin. known "hitler time" according history of dst in europe.
the times zones of europe shifted around dramatically during , after war. example, this post (supposedly royal observatory of greenwich) describes of these shifts including "double" dst. these shifts interesting cases of time zones playing important role in history. at to the lowest degree 1 academic uses term "chronopolitics" such phenomenon.
java datetime timezone simpledateformat
No comments:
Post a Comment