formatTime
The formatTime() function formats a TheTime using a custom format string.
Interactive example
Syntax
Curried signature
typescript
function formatTime<
GenericInput extends TheTime,
GenericFormat extends string
>(
formatString: GenericFormat
): (input: GenericInput) => stringClassic signature
typescript
function formatTime<
GenericInput extends TheTime,
GenericFormat extends string
>(
input: GenericInput,
formatString: GenericFormat
): stringParameters
input:TheTimevalue (classic signature only).formatString: Format string.
Return value
Formatted string based on the provided tokens.
Available tokens
WW: 2-digit weeksDD: 2-digit daysHH: 2-digit hoursmm: 2-digit minutesss: 2-digit secondsSSS: 3-digit milliseconds
