How do i know the server timestamp using the salesforce REST services ? Simialr to SOAP getServerTimestamp service, do we have any REST service ?

1 Answer 1


There is no such REST API available out of box for the same i guess .I had to implement my own custom REST API class for the same as below


 global with sharing class GetCurrentServerDateTime {

global class ResponseWrapper{
    public String currentServerTime;

global static ResponseWrapper returnCurrentServerTime(){    

    dateTime newDate=system.now();      
    String dateInFormat = newDate.formatGMT('yyyy-MM-dd HH:mm:ss');
    ResponseWrapper resWrap=new ResponseWrapper();

    system.debug('Server time being sent:'+dateInFormat);
    return resWrap;

The urI would be /services/apexrest/currentservertime

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .