2017-06-12 05:28:41 -07:00
|
|
|
/**
|
|
|
|
* DateTime tests.
|
|
|
|
*
|
|
|
|
* @author bwhitn [brian.m.whitney@outlook.com]
|
|
|
|
*
|
|
|
|
* @copyright Crown Copyright 2017
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
2019-07-09 12:23:59 +01:00
|
|
|
import TestRegister from "../../lib/TestRegister.mjs";
|
2017-06-12 05:28:41 -07:00
|
|
|
|
|
|
|
TestRegister.addTests([
|
|
|
|
{
|
|
|
|
name: "Filetime to Unix",
|
|
|
|
input: "129207366395297693",
|
|
|
|
expectedOutput: "1276263039529769300",
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
op: "Windows Filetime to UNIX Timestamp",
|
2017-07-03 15:25:14 +00:00
|
|
|
args: ["Nanoseconds (ns)", "Decimal"],
|
2017-06-12 05:28:41 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Unix to Filetime",
|
|
|
|
input: "1276263039529769300",
|
|
|
|
expectedOutput: "129207366395297693",
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
op: "UNIX Timestamp to Windows Filetime",
|
2017-07-03 15:25:14 +00:00
|
|
|
args: ["Nanoseconds (ns)", "Decimal"],
|
2017-06-12 05:28:41 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2024-02-21 19:55:09 +02:00
|
|
|
{
|
|
|
|
name: "DateTime Delta Positive",
|
|
|
|
input: "20/02/2024 13:36:00",
|
|
|
|
expectedOutput: "20/02/2024 13:37:00",
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
op: "DateTime Delta",
|
2024-04-01 19:42:56 +03:00
|
|
|
args: ["Standard date and time", "DD/MM/YYYY HH:mm:ss", "Add", 0, 0, 1, 0],
|
2024-02-21 19:55:09 +02:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "DateTime Delta Negative",
|
|
|
|
input: "20/02/2024 14:37:00",
|
|
|
|
expectedOutput: "20/02/2024 13:37:00",
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
op: "DateTime Delta",
|
2024-04-01 19:42:56 +03:00
|
|
|
args: ["Standard date and time", "DD/MM/YYYY HH:mm:ss", "Subtract", 0, 1, 0, 0],
|
2024-02-21 19:55:09 +02:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2017-06-12 05:28:41 -07:00
|
|
|
]);
|