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
Mangi S V V Satya Surya Sravan KumMangi S V V Satya Surya Sravan Kum 

hey. any please help me to find the day of the birthday like Monday, Tuesday........, using apex

Best Answer chosen by Mangi S V V Satya Surya Sravan Kum
Suraj Tripathi 47Suraj Tripathi 47
Hi Mangi,
 
public class dobClass{
    public static void dobMethod(){
        Date dob= Date.newInstance(1998, 6, 1);
        Datetime dt = DateTime.newInstance(dob, Time.newInstance(0, 0, 0, 0));
        String dayOfWeek=dt.format('EEEE');
        System.debug('Day : ' + dayOfWeek);
    }
}

In case you find any other issue please mention. 
If you find your Solution then mark this as the best answer. 

All Answers

Suraj Tripathi 47Suraj Tripathi 47
Hi Mangi,
 
public class dobClass{
    public static void dobMethod(){
        Date dob= Date.newInstance(1998, 6, 1);
        Datetime dt = DateTime.newInstance(dob, Time.newInstance(0, 0, 0, 0));
        String dayOfWeek=dt.format('EEEE');
        System.debug('Day : ' + dayOfWeek);
    }
}

In case you find any other issue please mention. 
If you find your Solution then mark this as the best answer. 
This was selected as the best answer
CharuDuttCharuDutt
Hii Magni
Try Below Code
Datetime dt = DateTime.newInstance(Date.today(), Time.newInstance(0, 0, 0, 0));
String dayOfWeek=dt.format('EEEE');
System.debug('Day : ' + dayOfWeek);

OR

Datetime dt = System.now();
System.debug(dt.format('EEEE'));
Please Mark It As Best Answer If It Helps
Thank You!