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