Skip to main content Home
About About the Design SystemRoadmap
Get started OverviewDesignersDevelopers
Foundations OverviewColorGridIconographyInteractionsSpacingTypography
Tokens Overview Global colorbox shadowTypographyborderopacityspacelengthIconBreakpointsMedia Queries
Elements All elements Accordion Alert Announcement Audio player Avatar Back to top Badge Blockquote Breadcrumb Button Card Chip Code block Call to action Dialog Disclosure Footer Health index Icon Jump links Navigation (primary) Navigation (secondary) Pagination PopoverPlanned Progress stepsPlanned Site status Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed
Theming OverviewColor PalettesCustomizingDevelopers
Patterns All PatternsCardTabsFilterFormLinkLink with iconLogo wallSearch barSkip navigationSticky bannerSticky cardTileVideo thumbnail
Personalization All Personalization PatternsAnnouncement
Accessibility FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers
Design/code status Release notes Get support

Timestamp

OverviewStyleGuidelinesCodeAccessibilityDemos
ImportingUsagerh-timestampImportingUsagerh-timestamp

Importing

Add rh-timestamp to your page with this import statement:

<script type="module">
  import '@rhds/elements/rh-timestamp/rh-timestamp.js';
</script>
Copy to Clipboard Wrap lines

To learn more about installing RHDS elements on your site using an import map read our getting started docs.

Usage

<rh-timestamp date="Tue Aug 09 2006 14:57:00 GMT-0400"></rh-timestamp>

<script type="module">
  import '@rhds/elements/rh-timestamp/rh-timestamp.js';
</script>
Copy to Clipboard Wrap lines

rh-timestamp

A timestamp provides consistent formats for displaying date and time values.

Slots 0
None
Attributes 8
Attribute DOM Property Description Type Default
date-format dateFormat

Custom date formatting style. See MDN for options.

DateTimeFormat | undefined
unknown
time-format timeFormat

Custom time formatting style. See MDN for options.

DateTimeFormat | undefined
unknown
display-suffix displaySuffix

Text to display after the timestamp

string | undefined
unknown
locale locale

Overrides the runtime's default locale

string | undefined
unknown
relative relative

Formats a timestamp in realtive terms

boolean | undefined
unknown
utc utc

Sets the timezone as UTC

boolean | undefined
unknown
hour-12 hour12

Whether to use 12-hour time (as opposed to 24-hour time)

boolean | undefined
unknown
date date

A string value representing a date

unknown
unknown
Methods 0
None
Events 0
None
CSS Shadow Parts 0
None
CSS Custom Properties 0
None
Design Tokens 0
None
© 2021-2025 Red Hat, Inc. Deploys by Netlify