From 1c4c99f0c19f19424e3aee04e868c38333164dd9 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sun, 24 Dec 2023 08:13:33 +0000 Subject: Generate sitemap.xml, robots.txt --- src/util/timestamp.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/util') diff --git a/src/util/timestamp.ts b/src/util/timestamp.ts index 01b78fb..39683cc 100644 --- a/src/util/timestamp.ts +++ b/src/util/timestamp.ts @@ -63,3 +63,10 @@ export function getTimestamp(seconds: number): string { return dateArr.map(encodeBase62).join(".") + "-0"; } + +/** + * Returns a date in the ISO-8601 format + */ +export function formatDate(date: Date): string { + return date.getUTCFullYear() + "-" + (date.getUTCMonth() + 1) + "-" + date.getUTCDate(); +} -- cgit