Formatted Time
lightning:formattedTime
Displays a formatted time in user's locale format. This component requires API version 42.0 and later.
For Aura components only. For LWC development, use lightning-formatted-time.
For Use In
Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App, Mobile Offline
A lightning:formattedTime component displays a read-only representation of time in the user's locale format. A valid ISO8601 formatted time string must be used.
An ISO8601 formatted time string matches one of the following patterns.
- HH
- HH:mm
- HH:mm
.SSS
HH is the number of hours that have passed since midnight, and 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).
Offsets aren't supported, and the component ignores them. For example, 14:30+05:00 is treated as 14:30.
The following example returns 10:12:30 PM.
Salesforce uses the format HH:mm