Answers for "javascript get date in timestamp iso format"

2

iso string to timestamp javascript

// convert ISO string to JavaScript Date object
let date = new Date("2021-06-02T14:13:54.470Z");

// convert Date object UNIX timestamp
Math.floor(date / 1000) // 1622643234
Posted by: Guest on June-02-2021
2

how to get time and date from iso string javascript

const myDate = "2012-10-16T11:00:28.556094Z";
const time = new Date(myDate).toLocaleTimeString('en',
                 { timeStyle: 'short', hour12: false, timeZone: 'UTC' });

// Output:  "11:00"
Posted by: Guest on January-04-2021

Code answers related to "javascript get date in timestamp iso format"

Code answers related to "Javascript"

Browse Popular Code Answers by Language