40.formatDateTime

Write a function named formatDateTime that receives two parameters:

  • a Date - date
  • a string representing a locale - locale

The function should return a new string, formatted according to the locale. See below examples for more details.

Hint: use the Intl.DateTimeFormat API

Example 1

Input

date

=

locale

=

Output

Example 2

Input

date

=

locale

=

Output