Unix timestamp nodejs

Code examples

8
0

javascript timestamp in seconds

const ts = () => Math.floor(new Date().getTime() / 1000);
6
0

javasctipt unix timestamp from date

Math.round(new Date().getTime() / 1000).toString()
5
0

how to get timestamp in javascript of a date object

new Date().getTime()

new Date().valueOf()
2
0

node get unix timestamp

Math.floor(new Date() / 1000) // in seconds
0
0

node js unix timestamp

function getUnixTime() {
  return (Date.now() / 1000) | 0;  
}

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................