Calendar months wrong

前端 未结 3 1665
栀梦
栀梦 2021-01-23 03:16

I try to set a simple date certain years after with calendar:

String date is a parameter of this metod.

     SimpleDateFormat format = new SimpleDateForm         


        
3条回答
  •  自闭症患者
    2021-01-23 03:55

    You have to use uppercase for month, otherwise you get minutes =) try:

    dd.MM.yyyy
    

    More: http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html

提交回复
热议问题