Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am displaying User field 'date of hire' in table via remoting. On my end it shows correctly but on client's side date is displayed one day before. I doubt something wrong is occurring in javascript. below is the javascript code.

var formatdate = new Date(response[i].date_Of_Hire__c);
if(formatdate != 'Invalid Date')
    hireDate = month_name[formatdate.getMonth()]+" "+formatdate.getDate()+",       "+formatdate.getFullYear();

Please suggest what am I doing wrong here?

Thanks in advance.

share|improve this question
What is your UTC offset. It is likely that the value being transferred is in UTC. – Daniel Ballinger May 26 '14 at 9:37
up vote 4 down vote accepted

The issue is most likely the transfer of Dates in the UTC timezone rather than the browsers timezone or that of the Salesforce User. Note that Salesforce stores the values in UTC and then converts them for display based on the current users timezone offset.

There is a Javascript function in Convert UTC date time to local date time using JavaScript that will convert from UTC to the browsers reported timezone offset.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.