timestamp to date [js]
This commit is contained in:
parent
1adca23620
commit
bf0ab3e019
6
~/JavaScript/timestamp_to_date.js
Normal file
6
~/JavaScript/timestamp_to_date.js
Normal file
@ -0,0 +1,6 @@
|
||||
/*
|
||||
Необходимо timestamp умножить на 1000, поскольку JavaScript отсчитывает время
|
||||
с момента epoch (который равен 01/01/1970) в миллисекундах, а не в секундах.
|
||||
*/
|
||||
|
||||
let date = new Date(timestamp * 1000);
|
Loading…
Reference in New Issue
Block a user