15 lines
251 B
JavaScript
15 lines
251 B
JavaScript
|
function unixLocal(unix) {
|
||
|
var jsTime = unix*1000
|
||
|
var dt = new Date(jsTime)
|
||
|
return dt.toLocaleString()
|
||
|
}
|
||
|
|
||
|
function jsUnix(js) {
|
||
|
var preRound = js / 1000
|
||
|
return Math.round(preRound)
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
unixLocal,
|
||
|
jsUnix,
|
||
|
}
|