Why does Java's Date.getYear() return 111 instead of 2011?

后端 未结 6 1995
抹茶落季
抹茶落季 2020-11-28 09:25

I am having a bit of trouble parsing a string date to a Date object. I use a DateFormat to parse the string, and when I print the value of the date

6条回答
  •  有刺的猬
    2020-11-28 09:54

    This is only a guess, but the 111 could be the number of years since 1900. Take a look at documentation/do some tests to verify this (I can't check at the moment)

提交回复
热议问题