User Story
Create a for loop which outputs all the dates of a specific month of year along with day in words.
Year and Month must be dynamic.
Expected Outcome
Parameters:
1983-03-01 05:00:00 ==> Tuesday
1983-03-02 05:00:00 ==> Friday
1983-03-03 05:00:00 ==> Saturday
.
.
.
Code
Integer year = 1983;
Integer month = 3;
Integer dayinMonth = Date.daysInMonth(year, month);
for(Integer i=1; i<=dayinMonth; i++){
Datetime date1 = Datetime.newInstance(year, month, i);
String DayInwords = date1.format('EEEE');
System.debug(date1 +' ==> ' + DayInwords);
}
Video
Video does not exists.