Formify Docs

Time

Format 24-hour time with optional seconds

Time

The time formatter masks a 24-hour time string into HH:mm or HH:mm:ss.

Options

OptionTypeDefaultDescription
secondsbooleanfalseInclude the seconds part (HH:mm:ss).

Usage

validationSchema: {
  start: { format: { type: "time" } },
  exact: { format: { type: "time", options: { seconds: true } } },
}

Results

TypedsecondsResult
1430false14:30
143055true14:30:55

Things to know

  • Pair with the time validator (time: true) for validation.

On this page