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
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