function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
meghna nmeghna n 

date format in lightning:formatteddatetime

I am using a lightning:formatteddatetime inside lightning component

 <lightning:formattedDateTime value="{!v.claimDetails.effectiveDate}" year="numeric" month="numeric" day="2-digit"/>

It is displaying date as 05/15/2019

How to make the date display as   05/15/2019 instead of     5/15/2019

Vikash GoyalVikash Goyal
Hi Meghna,

You can try this :

<lightning:formattedDateTime value="{!v.claimDetails.effectiveDate}" year="numeric" month="2-digit" day="2-digit"/>

Deepali KulshresthaDeepali Kulshrestha
Hi Meghna,

Greetings to you!

Use the below code to solve your problem.
And you can modify it accordingly.
<aura:component >
<p><lightning:formattedDateTime value="1567421168000" year="numeric" month="2-digit" day="2-digit"/></p>    
Use the below link.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha