Activity Forums Salesforce® Discussions Salesforce API: Get the Time on the Salesforce Server.

  • Manu

    Member
    February 24, 2019 at 7:12 pm

    Hi Kavya,

    Try this...

    public class MaintCalendar {
        String LongDate = ‘ ‘;
        // Init cLongDate with the current Datetime in long date format
        public String getLongDate() {
            Datetime cDT = System.now();
            LongDate = cDT.format(‘EEEE, MMMM d, yyyy’);
            return LongDate;
        }
    }

    Refer: https://developer.salesforce.com/forums/?id=906F00000008vERIAY

    Thanks,
    Manu

  • Manu

    Member
    February 24, 2019 at 7:14 pm

    String dateInFormat = newDate.formatGMT('yyyy-MM-dd HH:mm:ss');

    https://developer.salesforce.com/forums/?id=906F00000009ArvIAE

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos