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