2023-07-24 01:04:55 +01:00
|
|
|
function unixLocal(unix: number) {
|
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
|
|
|
}
|
|
|
|
|
2023-07-24 01:04:55 +01:00
|
|
|
function jsUnix(js: number) {
|
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,
|
|
|
|
};
|