Date constructor java

前端 未结 6 1725
别那么骄傲
别那么骄傲 2021-01-18 04:49

Hello I am trying to get the current date at java at a Class I created but everything fails. I\'ve seen in many sites e.g. http://www.mkyong.com/java/java-date-and-calenda

6条回答
  •  醉话见心
    2021-01-18 05:32

    You can also use use java.util.Calendar as follows:

    Calendar c = Calendar.getInstance();
    java.util.Date date = c.getTime();
    

提交回复
热议问题