dateTimeFormatter @localizer/format-datetime 1.1.1
The dateTimeFormatter
provides a flexible and customizable way to format dates and times. It allows you to define specific formatting options, such as the display of weekdays, months, days, hours, and minutes, making it suitable for a wide range of localization and presentation needs.
Usage
typescript
import { dateTimeFormatter } from '@localizer/format-datetime';
const formatter = dateTimeFormatter({
weekday: 'long',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
});
const result = formatter(new Date(2025, 2, 23, 11, 59, 0));
See formatter options for configuration details.
Demo
Locale | Localized value |
---|---|
en-US | 3/23/2025 |
fr-FR | 23/03/2025 |
de-DE | 23.3.2025 |
fi-FI | 23.3.2025 |
sv-FI | 2025-03-23 |
ko-KR | 2025. 3. 23. |
hi-IN | 23/3/2025 |