+ Start a Discussion
Rajat BurmanRajat Burman 

how to change my datatime format to January 8, 2018 format

Hi Experts,  
I am pulling and assigning the date value like the below code. 
for(Application__c AppRound : AppRoundData) {
Date uploadFinanceSponsor =  AppRound.Application_Round__r.Deadline_for_Uploading_Finances_Sponsors__c;
}
I need to change the date to January 8, 2018 format.
v varaprasadv varaprasad
Hi Rajat,

Please check sample code below:
 
string st = AppRound.Application_Round__r.Deadline_for_Uploading_Finances_Sponsors__c.format('MMM d, yyyy');
system.debug('==st=='+st);

More info :
http://grahambarnard.com/development/2016/02/29/salesforce-date-formats-in-apex/
https://developer.salesforce.com/forums/?id=906F00000005JhnIAE




Hope this helps you!

Thanks
Varaprasad
For Support: varaprasad4sfdc@gmail.com


 
Rajat BurmanRajat Burman
Thanks, Varaprasad.