How do I format a timestamp in Javascript to display it in graphs? UTC is fine

后端 未结 3 1272
-上瘾入骨i
-上瘾入骨i 2021-02-13 02:19

Basically, I receive raw timestamps and I need to format them into HH:MM:SS format.

3条回答
  •  -上瘾入骨i
    2021-02-13 03:03

    This will display the current time in the format you asked for (HH:MM:SS)

    function dostuff()
    {
     var item = new Date();
     alert(item.toTimeString());
    }
    

提交回复
热议问题