How to get today's Date?

后端 未结 8 1945
予麋鹿
予麋鹿 2021-01-31 14:28

In other words, I want functionality that provides Joda-Time:

today = today.withTime(0, 0, 0, 0);

but without Joda-Time, only with java.util.Da

8条回答
  •  时光取名叫无心
    2021-01-31 14:56

    DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    Date date = new Date();
    System.out.println(dateFormat.format(date));
    

    found here

提交回复
热议问题