Formatting Dates With the DateTimeFormat Object
JavaScript’s Intl.DateTimeFormat formats dates for different locales without manual string handling. It accepts locale tags and options, and also offers methods for parts, ranges, and resolved settings.