Update FromWindows64bitTimeStamp.mjs

This commit is contained in:
Michael H 2024-06-12 09:31:11 +01:00 committed by GitHub
parent bc773abcfc
commit cb2d2317d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,6 @@ class FromWindows64bitTimestamp extends Operation {
*/ */
constructor() { constructor() {
super(); super();
this.name = "From Windows 64-bit Filetime Timestamp"; this.name = "From Windows 64-bit Filetime Timestamp";
this.module = "Default"; this.module = "Default";
this.description = "Converts Windows 64-bit Hex Filetime Timestamp to datetime string<br><br>e.g. <code>01CEE16F415343EE</code> becomes <code>14 November 2013 19:21:19 UTC</code><br><br>windows 64-bit filetime timestamp is a 8 Byte Hex value representing the number of 100s of nanoseconds since January 1, 1601 UTC<br><br> Use with swap endianness recipe if required."; this.description = "Converts Windows 64-bit Hex Filetime Timestamp to datetime string<br><br>e.g. <code>01CEE16F415343EE</code> becomes <code>14 November 2013 19:21:19 UTC</code><br><br>windows 64-bit filetime timestamp is a 8 Byte Hex value representing the number of 100s of nanoseconds since January 1, 1601 UTC<br><br> Use with swap endianness recipe if required.";
@ -34,13 +33,10 @@ class FromWindows64bitTimestamp extends Operation {
* @throws {OperationError} if invalid unit * @throws {OperationError} if invalid unit
*/ */
run(input, args) { run(input, args) {
const h = parseInt(input, 16); const h = parseInt(input, 16);
const secs = h/10000000; const secs = h/10000000;
const d = moment.unix(secs - 11644473600); const d = moment.unix(secs - 11644473600);
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();
} }
} }