“JS dostaje aktualne sekundy” Kod odpowiedzi

JS dostaje aktualne sekundy

// Rounds the value
const timestamp = Math.round(new Date() / 1000); // 1405792937

// - OR -

// Floors the value
const timestamp = new Date() / 1000 | 0; // 1405792936
Modern Mouse

JS dostaje aktualne sekundy

const timestamp = new Date() / 1000; // 1405792936.933
// Technically, .933 would be milliseconds. 
Modern Mouse

Odpowiedzi podobne do “JS dostaje aktualne sekundy”

Pytania podobne do “JS dostaje aktualne sekundy”

Więcej pokrewnych odpowiedzi na “JS dostaje aktualne sekundy” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu