Font Awesome Build Awesome
Search ⌘KCtrl+K
Light Dark System Docs Color Scheme: System \ Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Theme: Default Icon Style: Classic Regular
Solid Regular Light Thin Classic Sharp Duotone Sharp Duotone
Docs Most styles require Font Awesome Pro.
Server-Side Rendering: Off Server-Side Rendering Docs
View on GitHub
Start Components Docs Help
Web Awesome Font Awesome Build Awesome
Search this site… /
Light Dark System Docs Color Scheme: System \ Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Theme: Default Icon Style: Classic Regular
Solid Regular Light Thin Classic Sharp Duotone Sharp Duotone
Docs Most styles require Font Awesome Pro.
Server-Side Rendering: Off Server-Side Rendering Docs
View on GitHub
Components

Getting Started

  • Installation
  • Usage
  • Forms
  • Localization
  • Frameworks
  • Using with AI
  • Figma Design Kit ProThis requires access to Web Awesome Pro
  • Server Rendering

Resources

  • Accessibility
  • Browser Support
  • Contributing
  • Patterns ProPatterns require access to Web Awesome Pro
  • Migrating from Shoelace
  • Visual Tests
  • Changelog
  • Help & Support

Theming & Utilities

  • Overview
  • Built-in Themes
  • Color Palettes
  • Design Tokens
  • Customizing & Theming
  • CSS Utilities

Actions

  • Button
  • Button Group
  • Copy Button
  • Dropdown
    • Dropdown Item

Forms

  • Checkbox
  • Checkbox Group
  • Color Picker
  • Input
  • Known Date
  • Number Input
  • OTP Input
  • Radio Group
    • Radio
  • Rating
  • Select
    • Option
  • Slider
  • Switch
  • Tag Input
  • Textarea
  • Time Input

Layout

  • Accordion
    • Accordion Item
  • Card
  • Details
  • Dialog
  • Divider
  • Drawer
  • Page
  • Scroller
  • Split Panel
  • Timeline
    • Timeline Item

Navigation

  • Breadcrumb
    • Breadcrumb Item
  • Pagination
  • Stepper
    • Step
  • Tab Group
    • Tab
    • Tab Panel
  • Tree
    • Tree Item

Feedback

  • Badge
  • Callout
  • Progress Bar
  • Progress Ring
  • Skeleton
  • Spinner
  • Tag
  • Toast
    • Toast Item
  • Tooltip

Media

  • Animated Image
  • Avatar
  • Carousel
    • Carousel Item
  • Code Highlighter
  • Comparison
  • Icon
  • Lightbox
    • Lightbox Item
  • Markdown
  • QR Code
  • Zoomable Frame

Data Viz

  • Advanced Usage

Helpers

  • Animation
  • Counter
  • Format Bytes
  • Format Date
  • Format Number
  • Include
  • Intersection Observer
  • Mutation Observer
  • Number Ticker
  • Popover
  • Popup
  • Random Content
  • Relative Time
  • Resize Observer

Format Date

  • Examples
  • Date & Time Format
  • Hour Format
  • Localization
  • API
  • Importing
  • Attributes & Properties
On This Page...
  • Examples
  • Date & Time Format
  • Hour Format
  • Localization
  • API
  • Importing
  • Attributes & Properties

Format Date

<wa-format-date>
Stable Helpers Since 2.0

Formats a date or time for display using the specified locale and options. Powered by the Intl.DateTimeFormat API for consistent, localized output.

<!-- Web Awesome 3 release date 🎉 -->
<wa-format-date date="2025-12-02T00:00:00-05:00"></wa-format-date>

Localization is handled by the browser's Intl.DateTimeFormat API. No language packs are required.

The date attribute determines the date/time to use when formatting. It must be a string that Date.parse() can interpret or a Date object set via JavaScript. If omitted, the current date/time will be assumed.

Always use ISO 8601 date strings.
Ambiguous formats like 03/04/2020 can be read as March 4 or April 3 depending on the user's browser and locale. A valid ISO 8601 date time string parses the same for every client.

Examples

Link to This Section

Date & Time Format

Link to This Section

Formatting options are based on those found in the Intl.DateTimeFormat API. When formatting options are provided, the date/time will be formatted according to those values. When no formatting options are provided, a localized, numeric date will be displayed instead.






<!-- Human-readable date -->
<wa-format-date month="long" day="numeric" year="numeric"></wa-format-date><br />

<!-- Time -->
<wa-format-date hour="numeric" minute="numeric"></wa-format-date><br />

<!-- Weekday -->
<wa-format-date weekday="long"></wa-format-date><br />

<!-- Month -->
<wa-format-date month="long"></wa-format-date><br />

<!-- Year -->
<wa-format-date year="numeric"></wa-format-date><br />

<!-- No formatting options -->
<wa-format-date></wa-format-date>

Hour Format

Link to This Section

By default, the browser will determine whether to use 12-hour or 24-hour time. To force one or the other, set the hour-format attribute to 12 or 24.


<wa-format-date hour="numeric" minute="numeric" hour-format="12"></wa-format-date><br />
<wa-format-date hour="numeric" minute="numeric" hour-format="24"></wa-format-date>

Localization

Link to This Section

Use the lang attribute to set the date/time formatting locale.

English:
French:
Russian:
English: <wa-format-date lang="en"></wa-format-date><br />
French: <wa-format-date lang="fr"></wa-format-date><br />
Russian: <wa-format-date lang="ru"></wa-format-date>

API

Link to This Section

Importing

Link to This Section

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.

CDN npm Self-Hosted React

Import this component directly from the CDN:

import 'https://ka-f.webawesome.com/[email protected]/components/format-date/format-date.js';

After installing Web Awesome via npm, import this component:

import '@awesome.me/webawesome/dist/components/format-date/format-date.js';

If you're self-hosting Web Awesome, import this component from your server:

import './webawesome/dist/components/format-date/format-date.js';

To import this component for React 18 or below, use the following code:

import WaFormatDate from '@awesome.me/webawesome/dist/react/format-date/index.js';

Attributes & Properties

Link to This Section

Learn more about attributes and properties.

Name Description Reflects
date
date
The date/time to format. If not set, the current date and time will be used. When passing a string, it's strongly recommended to use the ISO 8601 format to ensure timezones are handled correctly. To convert a date to this format in JavaScript, use date.toISOString().
Type Date | string
Default new Date()
day
day
The format for displaying the day.
Type 'numeric' | '2-digit'
era
era
The format for displaying the era.
Type 'narrow' | 'short' | 'long'
hour
hour
The format for displaying the hour.
Type 'numeric' | '2-digit'
hourFormat
hour-format
The format for displaying the hour.
Type 'auto' | '12' | '24'
Default 'auto'
minute
minute
The format for displaying the minute.
Type 'numeric' | '2-digit'
month
month
The format for displaying the month.
Type 'numeric' | '2-digit' | 'narrow' | 'short' | 'long'
second
second
The format for displaying the second.
Type 'numeric' | '2-digit'
timeZone
time-zone
The time zone to express the time in.
Type string
timeZoneName
time-zone-name
The format for displaying the time.
Type 'short' | 'long'
weekday
weekday
The format for displaying the weekday.
Type 'narrow' | 'short' | 'long'
year
year
The format for displaying the year.
Type 'numeric' | '2-digit'
Need a hand? Report a bug Ask for help
Go Make Something Awesome
Version 3.15.0 © Fonticons, Inc.
  • Terms
  • Privacy
  • Refunds
  • Core License
  • Pro License

Quick Links

  • Components
  • CSS Utilities
  • Theming
  • Using with AI
  • Changelog
  • Help & Support

Recent Searches

    D'oh! No results for “”

    Suggest on GitHub Ask on Discord
    Navigate Select
    Close Esc