Formats a date according to the specified options.

  • Parameters

    • timestamp: string | number | Date

      The timestamp to format.

    • dateStyle:
          | undefined
          | "long"
          | "short"
          | "medium"
          | "full" = 'medium'

      The date formatting style to use. Defaults to 'medium'.

    • locale: string = 'en-US'

      The locale to use for formatting. Defaults to 'en'.

    Returns string

    The formatted date string.