In salesforce organization Time Zone is (GMT+00:00) Greenwich Mean Time (Europe/London). and customer portal user Time Zone is (GMT-08:00) Pacific Standard Time (America/Los_Angeles)

Implemented code in Rest service API


customer portal user Access token, method as POST ,given date as 06/01/2014 and created a record in salesforce Date as 06/01/2014.

customer portal user Access token, method as GET, Displaying Date as 04/01/2014 and salesforce record Date as 06/01/2014.

why i am getting date as 04/01/2014. In salesforce it had value as 06/01/2014 Any reason behind why i am getting 04/01/2014.

  • Can you please share your REST API code for analysis? Jan 6, 2014 at 10:13
  • It has 1000 lines of code for my REST API. when i change customer portal user Time Zone to (GMT+00:00) Greenwich Mean Time (Europe/London) that time i am getting date as 06/01/2014. i think it only varies on timezone
    – nagarjuna
    Jan 6, 2014 at 10:33

1 Answer 1


Yes, It is Time Zone issue only. In your post request, you need to convert date to GMT+00:00 format and then save it to salesforce.

DateTime departureDateTimeGMTFormat = Datetime.newInstanceGmt( DeptDate.year(), DeptDate.month(), DeptDate.day(), integer.Valueof(DeptTime.substring(0, 2)),integer.Valueof( DeptTime.substring(2, 4)),00 );

DeptDateTime = departureDateTimeGMTFormat.format( 'yyyy.MM.dd HH:mm' , 'GMT+5:30');
  • Do this solves your problem? If yes then please mark up vote. Jan 6, 2014 at 10:53
  • Do u have any example on convert date to GMT format ?
    – nagarjuna
    Jan 6, 2014 at 11:03
  • I have added example in my answer above, Please check it Jan 6, 2014 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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