Activity Forums Salesforce® Discussions I want to know value of day from a given date, how to know it?

  • Piyush

    Member
    August 22, 2016 at 12:17 pm

    Hello ,

    You can try this sample of code to find the day name from given date.

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

    Thanks .

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos