Activity Forums Salesforce® Discussions how to convert date/time to date in Salesforce?

  • Sumit

    Member
    April 3, 2020 at 1:37 pm

    Try taking the Year, Month, and Day values out of the DateTime variable and pass them into the Date.newInstance() method.
    Here is some psuedo-code:
    DateTime dT = System.now();
    Date myDate = date.newinstance(dT.year(), dT.month(), dT.day());

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos