Activity Forums Salesforce® Discussions How can we get the day value from a date value in Salesforce?

  • Rachit

    Member
    April 14, 2016 at 8:36 am

    Hi Ajit,

    I think this will work for you

    DateTime dt1=DateTime.newInstance(date.today(), Time.newInstance(0, 0, 0, 0));
    String day=dt1.format('EEEE');

    Thanks

  • Parul

    Member
    September 19, 2018 at 11:59 pm

    Datetime dt = DateTime.newInstance(Date.today(), Time.newInstance(0, 0, 0, 0));
    String dayOfWeek=dt.format('EEEE');
    System.debug('Day : ' + dayOfWeek);

  • shariq

    Member
    September 20, 2018 at 8:11 pm

    Hi,

    Try this -

    DateTime testdate=DateTime.newInstance(date.today(), Time.newInstance(0, 0, 0, 0));
    String testday=testdate.format(‘EEEE’);

    System.debug(day);

    Hope this helps.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Pros & Cons of Lightning Component vs. 3rd party frameworks in Salesforce UI development

Video in

Nikita drops by to share his invaluable experience of using popular 3rd party frameworks in Salesforce. http://media.blubrry.com/salesforceway/audio.xmcdn.com/group42/M05/25/57/wKgJ81rXk6XjaZIAAU_I_KtprFM998.m4a