From d5a1bc9fa7abbf614378abfbbe7db676239438b9 Mon Sep 17 00:00:00 2001 From: chiko Date: Sun, 26 Oct 2025 14:05:08 +0100 Subject: [PATCH] Added Helper Functions for events.deleteDate. Its stored as integer for unixtime. --- src/util.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index 6f2f7ed..c8ab635 100644 --- a/src/util.ts +++ b/src/util.ts @@ -38,4 +38,7 @@ export function getTsNow() { seconds: now.getSeconds() } return rtn; -} \ No newline at end of file +} + +export function unixToDate( unix_timestamp: number ) { return new Date(unix_timestamp * 1000) } +export function dateToUnix( date: Date ) { return Math.round( date.getTime()/1000 ) } \ No newline at end of file