Getting current date in milliseconds (UTC) (NO use of strings)

前端 未结 5 2141
梦如初夏
梦如初夏 2021-02-18 18:35

Well, you might think that this question has already been asked, but I think it has not. The solutions I\'ve read about all had this \"jigsaw puzzle\" technique (like getU

5条回答
  •  星月不相逢
    2021-02-18 19:18

    This is an old question but for the sake of the new visitors here is the CORRECT answer:

    Date.now();
    

    It returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC

提交回复
热议问题