import { logger } from "./logger.utils";

function unixLocal(unix: number): string {
  logger.trace(`unixLocal: Converting time: ${unix}`)
  var jsTime = unix * 1000;
  var dt = new Date(jsTime);
  return dt.toLocaleString();
}

function jsUnix(js: number): number {
  logger.trace(`jsUnix: Converting time: ${js}`)
  return Math.floor(js / 1000);
}

export { jsUnix, unixLocal }

module.exports = {
  unixLocal,
  jsUnix,
};
