diff --git a/src/scripts/discord.ts b/src/scripts/discord.ts index 9da1387..21d03b5 100644 --- a/src/scripts/discord.ts +++ b/src/scripts/discord.ts @@ -103,8 +103,7 @@ const getActivity = (): SetActivity => { if (includeTimestamps) { const currentSeconds = convertDurationToSeconds(mediaInfo.current); const durationSeconds = convertDurationToSeconds(mediaInfo.duration); - const date = new Date(); - const now = Math.floor(date.getTime() / 1000); + const now = Math.trunc((Date.now() + 500) / 1000); presence.startTimestamp = now - currentSeconds; presence.endTimestamp = presence.startTimestamp + durationSeconds; }