Java Calendar Setting Incorrectly

前端 未结 6 1378
离开以前
离开以前 2021-01-25 13:34

I\'m having some trouble with Java\'s Calendar. I\'m parsing some data from a txt file, and need to create a date. After completion of the following code:

tmpYea         


        
6条回答
  •  旧巷少年郎
    2021-01-25 13:48

    months are indexed 0-11 instead of 1-12.
    0 = January
    1 = February
    ...
    11 = December
    Use tmpMonth = value -1 instead.

提交回复
热议问题