How to get today's Date?

后端 未结 8 1934
予麋鹿
予麋鹿 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 15:01

    Use this code ;

    String mydate = java.text.DateFormat.getDateTimeInstance().format(Calendar.getInstance().getTime());
    

    This will shown as :

    Feb 5, 2013 12:39:02PM

提交回复
热议问题