+ Start a Discussion
shra1_devshra1_dev 

REG: Date methods

Hi Devs,

 

 

Is there any inbuilt function in apex which converts the month format from MMM to MM (i.e, FEB to 02)

 

how to convert MMM to MM?

 

Please help me....

 

Regards,

Shravan

WizradWizrad

Hi shra,

 

Convert your date to a date time and utilize the Datetime.format(String format) method.

Pradeep_NavatarPradeep_Navatar

There are various methods in apex for date and datetime fields. You can use format() method to convert dafault datetime format into User defined format : start_date_time__c.format('MM/dd/yyyy');