+ Start a Discussion
sarvesh001sarvesh001 

How to get day name from input month and year

Hi all,
i want to get day name from input month and year.

Can anyone help me out for this.

Thanks,
Sarvesh.
Shashikant SharmaShashikant Sharma
You could achieve it with below code in the Apex Class.
 
Date d = date.newinstance(1947,8, 15);  
datetime myDate = datetime.newInstance(d.year(), d.month(), d.day());  
String day = myDate.format('EEEE');

Read this for more :
http://forceschool.blogspot.in/search/label/Calculate%20Day%20of%20Date%20in%20Apex