Skip to content

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

─── unset ───
─── unset ───
long
─── unset ───
─── unset ───
long
numeric
─── unset ───
numeric
numeric
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
LocaleLocalized value
en-US  American English3/23/2025
fr-FR  French (France)23/03/2025
de-DE  German (Germany)23.3.2025
fi-FI  Finnish (Finland)23.3.2025
sv-FI  Swedish (Finland)2025-03-23
ko-KR  Korean (South Korea)2025. 3. 23.
hi-IN  Hindi (India)23/3/2025

See also