Update ToMacAbsoluteTimestamp.mjs
This commit is contained in:
parent
3f3a09814d
commit
4d75206d3e
@ -26,7 +26,7 @@ class ToMacAbsoluteTimestamp extends Operation {
|
|||||||
this.inputType = "string";
|
this.inputType = "string";
|
||||||
this.outputType = "string";
|
this.outputType = "string";
|
||||||
this.args = [
|
this.args = [
|
||||||
{
|
{
|
||||||
"name": "Show parsed datetime",
|
"name": "Show parsed datetime",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"value": true
|
"value": true
|
||||||
@ -41,11 +41,10 @@ class ToMacAbsoluteTimestamp extends Operation {
|
|||||||
* @throws {OperationError} if invalid unit
|
* @throws {OperationError} if invalid unit
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const [showDateTime] = args,
|
const [showDateTime] = args,
|
||||||
d = moment.utc(input);
|
d = moment.utc(input);
|
||||||
let result = (d.unix()-978307200);
|
let result = (d.unix()-978307200);
|
||||||
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ToMacAbsoluteTimestamp;
|
export default ToMacAbsoluteTimestamp;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user