Update FromMacAbsoluteTimestamp.mjs
This commit is contained in:
parent
9a80f18a13
commit
bc773abcfc
@ -18,7 +18,6 @@ class FromMacAbsoluteTimestamp extends Operation {
|
|||||||
*/
|
*/
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.name = "From Mac Absolute Timestamp";
|
this.name = "From Mac Absolute Timestamp";
|
||||||
this.module = "Default";
|
this.module = "Default";
|
||||||
this.description = "Converts Apple Mac Absolute Timestamp to datetime string<br><br>e.g. <code>591621300</code> becomes <code>Tue 1 October 2019 11:15:00 UTC</code><br><br>Mac Absolute timestamp is a 32-bit value representing the number of seconds since January 1, 2001 UTC";
|
this.description = "Converts Apple Mac Absolute Timestamp to datetime string<br><br>e.g. <code>591621300</code> becomes <code>Tue 1 October 2019 11:15:00 UTC</code><br><br>Mac Absolute timestamp is a 32-bit value representing the number of seconds since January 1, 2001 UTC";
|
||||||
@ -34,11 +33,8 @@ class FromMacAbsoluteTimestamp extends Operation {
|
|||||||
* @throws {OperationError} if invalid unit
|
* @throws {OperationError} if invalid unit
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
|
|
||||||
const d = moment.unix(input + 978307200);
|
const d = moment.unix(input + 978307200);
|
||||||
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
|
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
|
||||||
|
|
||||||
throw new OperationError();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user