Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
hi
from a list iam getting a date how to find day of week for particular date using apex class
If you want to find day as Sunday, Monday, etc. You can achieve it as:
Datetime dt = DateTime.newInstance(Date.today(), Time.newInstance(0, 0, 0, 0));
dayOfWeek = dt.format('EEEE');
System.debug(dayOfWeek);
Hi,
There is no built in fuctionality but you can implement this. Please refer following link for logic and code :
http://salesforce.stackexchange.com/questions/1192/how-can-i-tell-the-day-of-the-week-of-a-date
Hi If you are getting date than you can find day in such a way:
Date d =date.today();
String day = String.valueOf(d.day());
thanks,
If you want to find day as Sunday, Monday, etc. You can achieve it as:
Datetime dt = DateTime.newInstance(Date.today(), Time.newInstance(0, 0, 0, 0));
dayOfWeek = dt.format('EEEE');
System.debug(dayOfWeek);
All Answers
Hi,
There is no built in fuctionality but you can implement this. Please refer following link for logic and code :
http://salesforce.stackexchange.com/questions/1192/how-can-i-tell-the-day-of-the-week-of-a-date
Hi If you are getting date than you can find day in such a way:
Date d =date.today();
String day = String.valueOf(d.day());
thanks,
If you want to find day as Sunday, Monday, etc. You can achieve it as:
Datetime dt = DateTime.newInstance(Date.today(), Time.newInstance(0, 0, 0, 0));
dayOfWeek = dt.format('EEEE');
System.debug(dayOfWeek);