formatTime

Source
import { formatTime } from "@prestojs/util";
formatTime(parts,options)

Format the parts of a time - as returned by parseTime - as a string using toLocaleString.

Note that while you can pass through options.timeZone this may be inaccurate if parts.timezoneOffset isn't supplied.

ParameterTypeDescription
*parts
TimeParts
|Date
options.localeOptions

Options to pass through to toLocaleString

options.localesstring|Array

Optional locales to use. See using locales for more information.

string