SpaceNinjaServer/src/constants/timeConstants.ts

22 lines
646 B
TypeScript
Raw Normal View History

export const EPOCH = 1734307200_000; // Monday, Dec 16, 2024 @ 00:00 UTC+0; should logically be the start of winter in 1999 iteration 0
2023-09-11 13:20:07 +02:00
const millisecondsPerSecond = 1000;
const secondsPerMinute = 60;
const minutesPerHour = 60;
const hoursPerDay = 24;
const daysPerWeek = 7;
2023-09-11 13:20:07 +02:00
2024-01-25 14:49:45 +01:00
const unixSecond = millisecondsPerSecond;
2023-09-11 13:20:07 +02:00
const unixMinute = secondsPerMinute * millisecondsPerSecond;
const unixHour = unixMinute * minutesPerHour;
const unixDay = hoursPerDay * unixHour;
const unixWeek = daysPerWeek * unixDay;
2023-09-11 13:20:07 +02:00
export const unixTimesInMs = {
2024-01-25 14:49:45 +01:00
second: unixSecond,
2023-09-11 13:20:07 +02:00
minute: unixMinute,
hour: unixHour,
day: unixDay,
week: unixWeek
2023-09-11 13:20:07 +02:00
};