How to get the number of milliseconds elapsed so far today

后端 未结 4 743
攒了一身酷
攒了一身酷 2021-02-13 07:02

I want to get the current time and date in milliseconds. How can I get this?

I tried this:

Date date=new Date() ;  
System.out.println(\"Today is \" +dat         


        
4条回答
  •  醉话见心
    2021-02-13 08:02

    Try:

    (d.getTime() % (86400000))
    

    Note: 86400000 is the number of milliseconds in a day.

提交回复
热议问题