backend/src/utils/timeConvert.utils.ts

15 lines
259 B
TypeScript
Raw Normal View History

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,
};