Completion of simple filetime conversion
This commit is contained in:
parent
003e076b00
commit
ae38bb0927
@ -2268,7 +2268,7 @@ const OperationConfig = {
|
|||||||
outputType: "string",
|
outputType: "string",
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
name: "Units",
|
name: "Output Units",
|
||||||
type: "Option",
|
type: "Option",
|
||||||
value: DateTime.UNITS
|
value: DateTime.UNITS
|
||||||
}
|
}
|
||||||
@ -2281,7 +2281,7 @@ const OperationConfig = {
|
|||||||
outputType: "string",
|
outputType: "string",
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
name: "Units",
|
name: "Input Units",
|
||||||
type: "Option",
|
type: "Option",
|
||||||
value: DateTime.UNITS
|
value: DateTime.UNITS
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
//import Decimal from "../lib/decimal.min.js";
|
|
||||||
import Utils from "../Utils.js";
|
|
||||||
import {BigInteger} from "jsbn";
|
import {BigInteger} from "jsbn";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,6 +80,13 @@ const DateTime = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@constant
|
||||||
|
*@default
|
||||||
|
*/
|
||||||
|
RADIX: ["Decimal", "Hex"],
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a Windows FILETIME to Unix Epoch time.
|
* Converts a Windows FILETIME to Unix Epoch time.
|
||||||
*
|
*
|
||||||
@ -92,7 +97,7 @@ const DateTime = {
|
|||||||
*/
|
*/
|
||||||
runFromFiletimeToUnix: function(input, args) {
|
runFromFiletimeToUnix: function(input, args) {
|
||||||
let units = args[0], offset = new BigInteger("116444736000000000");
|
let units = args[0], offset = new BigInteger("116444736000000000");
|
||||||
input = new BigInteger(input,16).subtract(offset);
|
input = new BigInteger(input).subtract(offset);
|
||||||
if (units === "Seconds (s)"){
|
if (units === "Seconds (s)"){
|
||||||
input = input.divide(new BigInteger("10000000"));
|
input = input.divide(new BigInteger("10000000"));
|
||||||
} else if (units === "Milliseconds (ms)") {
|
} else if (units === "Milliseconds (ms)") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user