Use JavaScript to Parse Time

前端 未结 4 493
春和景丽
春和景丽 2021-02-04 14:13

This is probably something easy, but I\'m a bit confused how to do this. How can I, using JavaScript, parse only the time from the following ISO 8601 date string:



        
4条回答
  •  走了就别回头了
    2021-02-04 14:35

    string.slice(11,16) will return 17:10. From there (possibly using slice in more interesting and exciting manners) it should be fairly simple to get it into 24-hour format.

提交回复
热议问题