n8n/packages/@n8n/constants/src/time.ts
Charlie Kolb e9e480bb8e
feat(core): Introduce WorkflowHistory compaction service (#23238)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-12-24 09:00:58 +01:00

25 lines
427 B
TypeScript

/**
* Convert time from any time unit to any other unit
*/
export const Time = {
milliseconds: {
toHours: 1 / (60 * 60 * 1000),
toMinutes: 1 / (60 * 1000),
toSeconds: 1 / 1000,
},
seconds: {
toMilliseconds: 1000,
},
minutes: {
toMilliseconds: 60 * 1000,
},
hours: {
toMilliseconds: 60 * 60 * 1000,
toSeconds: 60 * 60,
},
days: {
toSeconds: 24 * 60 * 60,
toMilliseconds: 24 * 60 * 60 * 1000,
},
};