You need to sign in to do that
Don't have an account?
dtaylor
DateTime Issues
Hi,
Can anyone please tell me what is wrong with the piece of code? I am trying to pull assets that have been updated since yesterday...
DateTime endTime = sfdc.getServerTimestamp().timestamp;
DateTime startTime = endTime.Subtract(new System.TimeSpan(1, 0, 0, 0, 0));
sforce.QueryResult qr = sfdc.query("Select Id from Asset Where SystemModstamp > " + startTime);
The error is:
System.Web.Services.Protocols.SoapException was unhandled
Message="MALFORMED_QUERY: \nAsset Where SystemModstamp > 11/27/2006 8:59:45 PM\n
^\nERROR at Row:1:Column:47\nunexpected char: '/'"
Code:
This way, we're comparing apples to apples.
System.Xml.XmlConvert.ToString(new DateTime(), System.Xml.XmlDateTimeSerializationMode.Utc)