Formats a time according to the specified options.

  • Parameters

    • timestamp: string | number | Date

      The timestamp to format.

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

      The time formatting style to use. Defaults to 'short'.

    • locale: string = 'en-US'

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

    Returns string

    The formatted time string.