2023-02-09 20:34:53 +00:00
|
|
|
function unixLocal(unix) {
|
2023-05-06 21:54:49 +01:00
|
|
|
var jsTime = unix*1000;
|
|
|
|
var dt = new Date(jsTime);
|
|
|
|
return dt.toLocaleString();
|
2023-02-09 20:34:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function jsUnix(js) {
|
2023-05-06 21:54:49 +01:00
|
|
|
var preRound = js / 1000;
|
|
|
|
return Math.round(preRound);
|
2023-02-09 20:34:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
2023-05-06 21:54:49 +01:00
|
|
|
unixLocal,
|
|
|
|
jsUnix,
|
|
|
|
};
|