Converts a date into a simple, unambiguous date string.
CAUTION: this does not user locale setting. Prefer toLocaleString whenever possible.
A day of the month: 1-31 depending on the month
Hour of the day in 24 time: 0-23
Optional
Millisecond of the second: 0-999
Minute of the hour: 0-59
A month of the year: 1-12
The full, four digit year.
2023; Copy
2023;
import {toSimpleString} from 'date-vir';let result = toSimpleString( { year: 2024, month: 4, day: 24, hour: 6, minute: 4, second: 9, millisecond: 123, timezone: utcTimezone, }, { includeSeconds: false, includeTimezone: false, },);// outputs:result = '2024-04-24 06:04'; Copy
import {toSimpleString} from 'date-vir';let result = toSimpleString( { year: 2024, month: 4, day: 24, hour: 6, minute: 4, second: 9, millisecond: 123, timezone: utcTimezone, }, { includeSeconds: false, includeTimezone: false, },);// outputs:result = '2024-04-24 06:04';
Converts a date into a simple, unambiguous date string.
CAUTION: this does not user locale setting. Prefer toLocaleString whenever possible.