Formatted Time

lightning-formatted-time

Displays a formatted time in user's locale format.

For Use In

Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App, Mobile Offline

A lightning-formatted-time component shows a read-only representation of time in the user's locale format. Use a valid ISO8601 formatted time string only.

An ISO8601 formatted time string matches one of these patterns.

  • HH:mm
  • HH:mm:ss
  • HH:mm:ss.SSS

HH is the number of hours that have passed since midnight, mm is the number of minutes that have passed since the start of the hour, ss is the number of seconds since the start of the minute, and SSS is the number of milliseconds since the start of the second. Time is always displayed in Universal Time (UTC).

lightning-formatted-time doesn't support offsets and it ignores them. For example, 14:30+05:00 is treated as 14:30.

This example returns 10:12:30 PM.

Salesforce uses the format HH:mm:ss.SSSZ for time fields. The time field is a timestamp without the date included. Time values in Salesforce aren't localized or associated with a time zone.

Object Reference for the Salesforce Platform: Field Types