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