MCPcopy Index your code
hub / github.com/simstudioai/sim / pad

Function pad

apps/sim/tools/langsmith/utils.ts:12–12  ·  view source on GitHub ↗
(value: number, length: number)

Source from the content-addressed store, hash-verified

10 const parsed = startTime ? new Date(startTime) : new Date()
11 const date = Number.isNaN(parsed.getTime()) ? new Date() : parsed
12 const pad = (value: number, length: number) => value.toString().padStart(length, '0')
13 const year = date.getUTCFullYear()
14 const month = pad(date.getUTCMonth() + 1, 2)
15 const day = pad(date.getUTCDate(), 2)

Callers 1

toCompactTimestampFunction · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected