From 4aa21cab5cf58d2899292ba49f718b5708a64e6a Mon Sep 17 00:00:00 2001 From: WlodekM Date: Tue, 26 Nov 2024 10:41:27 +0200 Subject: eugh i spent 2 hours on this --- timestamp.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 timestamp.ts (limited to 'timestamp.ts') diff --git a/timestamp.ts b/timestamp.ts new file mode 100644 index 0000000..cfa9a05 --- /dev/null +++ b/timestamp.ts @@ -0,0 +1,10 @@ +export default class Timespamp { + js: number; + unix: number; + str: string; + constructor (date: Date) { + this.js = Number(date) + this.unix = Math.floor(date.getTime() / 1000) + this.str = String(date) + } +} \ No newline at end of file -- cgit 1.4.1-2-gfad0