formatISO9075
import { formatISO9075 } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Represent 18 September 2019 in ISO 9075 format:
const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52))
//=> '2019-09-18 19:00:52'
@example
// Represent 18 September 2019 in ISO 9075, short format:
const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })
//=> '20190918 190052'
@example
// Represent 18 September 2019 in ISO 9075 format, date only:
const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })
//=> '2019-09-18'
@example
// Represent 18 September 2019 in ISO 9075 format, time only:
const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })
//=> '19:00:52'
function formatISO9075<DateType extends Date>(date: DateType | number | string, options?: FormatISO9075Options): string;
§
formatISO9075<DateType extends Date>(date: DateType | number | string, options?: FormatISO9075Options): string
[src]§Parameters
§
options?: FormatISO9075Options optional
[src]- An object with options.