GitHub

Format Date

Date/time formatting with individual parts, timezones, and locale support.

<rhx-format-date>

Examples

Custom Format

Individual Parts

Time

Timezone

Properties

Property Type Default Description
rhx-date DateTimeOffset - The date/time value to format
rhx-format string - .NET format string (e.g. yyyy-MM-dd)
rhx-weekday string - Weekday display: long, short, narrow
rhx-year string - Year display: numeric, 2-digit
rhx-month string - Month display: numeric, 2-digit, long, short, narrow
rhx-day string - Day display: numeric, 2-digit
rhx-hour string - Hour display: numeric, 2-digit
rhx-minute string - Minute display: numeric, 2-digit
rhx-second string - Second display: numeric, 2-digit
rhx-hour-format string - Clock format: 12, 24
rhx-timezone string - IANA timezone (e.g. America/New_York)

Accessibility

  • Renders as a <time> element with a datetime attribute for machine readability.
  • Screen readers announce the visible formatted text naturally.
  • The datetime attribute provides an unambiguous ISO 8601 value for assistive technologies.