From the iPhone application, I have to send the date as a parameter to the webservice method, where the server parsing logic is implemented using C #, .NET and JSON.
In my iPhone application, I format the date as:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]];
[dateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"];
NSString *myDateString = [dateFormatter stringFromDate:SentOn];
I get an error message:
Error deserializing an object of type DashboardDataContract.Contracts.DashboardInputParams. The contents of DateTime '2013-04-04T12: 00: 00Z' does not start with '/ Date (' and ends with ') /', as required for JSON. '.
I tried various date formatting. Can anyone help me in this regard?
source
share