clean-jsdoc-theme TypeDoc APIv0.0.0

formatDateTime

formatDateTime( date: string | number | Date, dateFormat: 'short' | 'medium' | 'long' | 'full', timeFormat: 'short' | 'medium' | 'long', options: DateFormatOptions, ): string

Source: date.ts:134

Formats a date and time together

Parameters

  • date (string | number | Date) — Date to format
  • dateFormat ("short" | "medium" | "long" | "full", default: "'medium'") — Date format style
  • timeFormat ("short" | "medium" | "long", default: "'short'") — Time format style
  • options (DateFormatOptions, default: "{}") — Additional options

Returns

  • string — Formatted datetime string

Example

CODE
formatDateTime(new Date(), 'short', 'short')
// '12/15/2024, 2:30 PM'