Update ToChromeBrowserTimeStamp.mjs

This commit is contained in:
Michael H 2024-06-12 11:53:14 +01:00 committed by GitHub
parent 779c5cab50
commit a726d975f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,6 @@
*/ */
import Operation from "../Operation.mjs"; import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs";
import moment from "moment-timezone"; import moment from "moment-timezone";
/** /**
@ -43,7 +42,7 @@ class ToChromeBrowserTimestamp extends Operation {
*/ */
run(input, args) { run(input, args) {
const [showDateTime] = args, const [showDateTime] = args,
d = moment.utc(input); d = moment.utc(input);
let result = ((d.unix()+11644473600) * 1000000); let result = ((d.unix()+11644473600) * 1000000);
return showDateTime ? `${result} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : result.toString(); return showDateTime ? `${result} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : result.toString();
} }