본문 바로가기

업무 관련/그날의 밥값

[Java/Android] current year through Date.setYear() saved as 3916

In Java/Android, current year saved as 3916(3917, 3918, 3919, 3920, 3921, 3922, 3923.....).


Don't use Date object.


It uses gregorian calendar.


So default 1900 plus to year.


1900 + 2016 = 3916

1900 + 2017 = 3917

.....


Recommend to use Calendar object.


More detail, Ref this URL.