diff options
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/timestamp.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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(); +} |
