Javascript获取当前unix时间戳

代码示例

8
0

javascript时间戳以秒为单位

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

javasctipt unix时间戳从日期

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

javascript获取时间戳

var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds
0
0

nodejs当前时间戳unix

Math.floor(+new Date() / 1000)
0
0

unix时间戳js

+ new Date()
0
0

节点js unix时间戳

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

其他语言

此页面有其他语言版本

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