How can I get the count of milliseconds since midnight for the current?

后端 未结 11 690
生来不讨喜
生来不讨喜 2021-01-30 03:45

Note, I do NOT want millis from epoch. I want the number of milliseconds currently on the clock.

So for example, I have this bit of code.

Date date2 = ne         


        
11条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-30 04:04

    Do you mean?

    long millis = System.currentTimeMillis() % 1000;
    

    BTW Windows doesn't allow timetravel to 1969

    C:\> date
    Enter the new date: (dd-mm-yy) 2/8/1969
    The system cannot accept the date entered.
    

提交回复
热议问题