Top

JavaScript Programming Usage

Mar 01, 2021 | 1979 views

#Web-frontend


Get timestamp from datetime format string:

## JavaScript code example
time = "2020-02-27T16:00:00.000Z"
"2020-02-27T16:00:00.000Z"
timestamp = Date.parse(time) / 1000
1582819200

## verify above timestamp
date -d "1970-01-01 UTC 1582819200 seconds"
Thu Feb 27 16:00:00 UTC 2020

Refer to:


Leave a comment

0 comments