function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RajanJasujaRajanJasuja 

Date format problem

Hi I am trying to store '2/27/2008 9:35:47 AM' date into Salesforce using C# and partner API of salesforce but getting the error

'2/27/2008 9:35:47 AM' is not a valid value for the type xsd:date

Any idea how to change date format into c# which is comparable with salesforce


Thanks



MystiMysti
Hi,

Are any of these compatible?

  • 1999-01-01T23:01:01+01:00
  • 1999-01-01T23:01:01-08:00
  • 1999-01-01T23:01:01Z

From the API guide for SOQL date formats:

http://www.salesforce.com/us/developer/docs/api/index_CSH.htm#sforce_api_calls_soql_select_dateformats.htm



SuperfellSuperfell
Use the .NET DateTime class to parse your string, then use it to generate an ISO8601 formatted version ( dt.ToString("G") If i remember correctly, check the docs)