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
Hari N 20Hari N 20 

Convert date into Day

Hi All,
I want to convert to today date into only day.

For example, date is 10/24/2016 and it is monday then I want to concert this date as monday and want to store in a string.
Please help me.
Please provide syntax for the same

Thanks in Advance

Best Answer chosen by Hari N 20
hi Hari
use this code
Date mydate = Date.newInstance(2016,10,24);
Datetime dt = DateTime.newInstance(mydate, Time.newInstance(0, 0, 0, 0));
String dayOfWeek=dt.format('EEEE');
System.debug('Day : ' + dayOfWeek);
output is
Mark it best answer if it helps you so it make proper solution for others :)