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
Ally Abdool Latiff MohabuthAlly Abdool Latiff Mohabuth 

Formula date - Format DD/MM/YYYY

Hello,

I am trying to return a date from a text field and i need to have it in the format of DD/MM/YYYY but i am getting it in the form of D/M/YYYY. 
For example, for 03/05/2010 i am getting 3/5/2010.

this is the formula i used: 
TEXT( Day( DateValue( Date_of_Birth__c) ) ) +'/'+ TEXT( MONTH( DateValue( Date_of_Birth__c) ) ) +'/'+ TEXT( YEAR( DateValue( Date_of_Birth__c) ) ), null )

Thank you!
VineetKumarVineetKumar
Try this:
IF(DAY(DateValue(Date_of_Birth__c)) < 10, TEXT(DAY(DateValue(Date_of_Birth__c))), '0'+TEXT(DAY(DateValue(Date_of_Birth__c)))) +'/'+ 
IF(MONTH(DateValue(Date_of_Birth__c)) < 10, TEXT(MONTH(DateValue(Date_of_Birth__c))), '0'+TEXT(MONTH(DateValue(Date_of_Birth__c)))) +'/'+ 	
TEXT(YEAR(DateValue(Date_of_Birth__c))), null)
Mind the brackets if I missed any.
FearNoneFearNone
add padding to your text...
LPAD ( TEXT( Day( DateValue( Date_of_Birth__c) ) ) ,2, '0' ) +'/'+ LPAD ( TEXT( MONTH( DateValue( Date_of_Birth__c) ) ) ,2, '0' ) +'/'+ TEXT( YEAR( DateValue( Date_of_Birth__c) ) )

 
Ally Abdool Latiff MohabuthAlly Abdool Latiff Mohabuth
thnx vineetkumar and fearnone (Y)
Gunjan Aswani 1Gunjan Aswani 1

IF( DAY(date__c) < 10, '0'+TEXT( DAY(date__c) ), TEXT( DAY(date__c) ) ) +'/'+ 
IF( MONTH(date__c) < 10, '0'+TEXT( MONTH(date__c) ), TEXT( MONTH(date__c) ) ) +'/'+     
TEXT(YEAR(date__c))

@Vineet your formula needs to be modified to this please have a look your first condition in if should have leading 0 not second also there was a missing bracket.