Correcting my Date Output from SimpleDateFormat

后端 未结 2 1603
说谎
说谎 2021-01-27 03:42

I am having a problem: Trying to use SimpleDateFormat with user input...

public static void main(String[] args) {
try {
SimpleDateFormat sdf = new SimpleDateForm         


        
2条回答
  •  梦谈多话
    2021-01-27 04:17

    The new SimpleDateFormat("MM/dd/YYYY",Locale.US); must be new SimpleDateFormat("MM/dd/yyyy",Locale.US);

    • YYYY = Week year
    • yyyy = Year

提交回复
热议问题