You need to sign in to do that
Don't have an account?
Jeff C.ax327
Saving and retrieving datetime values through SforceEnterprise API causes time offset
When I try to save a datetime value to Salesforce through the Enterprise API (SforceEnterprise), 4 hours gets subtracted from the time. When I retrieve a datetime value from Salesforce through the API, 4 hours gets added to the time. (my timezone is EST)
It seems obvious that this is a timezone issue, and I have tried the following to no avail:
mySalesforceObject.MyDatetimeField__c = new DateTime(dtmOrigDateTime, DateTimeKind.Utc);
I figured that by specifying that it is a UTC datetime, that would fix it, but it doesn't.
All I want is for the time to be saved and retrieved as is, with no subtraction or addition of hours.
Is there a setting on the sforceService object somewhere or on the SObject that can correct this behavior?
Thank you for your help, this is driving me nuts.
Jeff
dtmMyDateTime = ((DateTime)sfObj.MyDateTime__c).ToLocalTime();
Here is what I am doing
GetserverTimeStamp
format it into "yyyy'-'MM'-'dd'T'HH':'mm':'ss'
writing to a file
then reading the timestamp from file in a string
then adding to a query with where LastModifiedDate >= timestamp
It is not giving the right records because ServerTimeStamp gives the GMT time.
how would I do that.
I get binding.geUserInfo.GetTimeZone();
like
but how do we convert it to ("yyyy'-'MM'-'dd'T'HH':'mm':'ss'- xx:xx) format