From 1e7da4c61012b685eec1dfab907273e159dd7667 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Wed, 10 Nov 2021 19:50:21 -0500 Subject: [PATCH] make timestamp with seconds --- src/utils/helpers/getTimestamp.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/helpers/getTimestamp.ts b/src/utils/helpers/getTimestamp.ts index 0fdf05c3a..d4cc96979 100644 --- a/src/utils/helpers/getTimestamp.ts +++ b/src/utils/helpers/getTimestamp.ts @@ -7,6 +7,7 @@ export function getTimestamp(): string { const stringWidth = -2; const formattedHours: string = `0${d.getHours()}`.slice(stringWidth); const formattedMinutes: string = `0${d.getMinutes()}`.slice(stringWidth); + const formattedSeconds: string = `0${d.getSeconds()}`.slice(stringWidth); - return `${d.getMonth() + 1}/${d.getDate()} ${formattedHours}:${formattedMinutes}`; + return `${d.getMonth() + 1}/${d.getDate()} ${formattedHours}:${formattedMinutes}:${formattedSeconds}`; }