Timestamp issue for CRM Online 2011 – SDK

While communicating to CRM Online 2011 using the SDKs,the developers need to take the Server timezone factor into account else It might throw a timestamp exception.
In one of my projects, I encountered the following issue while communicating with a CRM Online 2011 Server.

“The security timestamp is stale because its expiration time (‘2011-09-05T11:24:24.000Z’) is in the past. Current time is ‘2011-09-05T22:48:04.267Z’ and allowed clock skew is ’00:05:00′.”
The code snippet was as follows.

 IOrganizationService service = (IOrganizationService)serviceProxy;Entity contact = new Entity "contact");//Specify the attributes

contact.Attributes["lastname"] = "Test LastName";//Execute the service

contactId = service.Create(contact);

}

There were no problems with the code. The problem was with the time difference between the OS and the CRM Online timezones.

I fixed the issue just by adjusting the OS time.

OrgService = { new OrganizationServiceProxy(new Uri(orgservice), null, liveIDCreds, deviceIDcreds);Guid contactId = Guid.Empty; using (serviceProxy = new OrganizationServiceProxy(OrganizationUri, null, liveIDCreds, deviceIDcreds))
150 150 Burnignorance | Where Minds Meet And Sparks Fly!