Answers for "dateTime to date in js"

0

dateTime to date in js

let dateStr =new Date("Wed Aug 05 18:11:48 UTC 2020")

dateStr.toLocaleDateString()
// "05/08/2020"

dateStr.toTimeString()
// "23:41:48 GMT+0530 (India Standard Time)"
Posted by: Guest on July-03-2021

Browse Popular Code Answers by Language