Dall'applicazione iPhone, devo inviare la data come parametro a un metodo webservice in cui la logica di analisi del server è implementata con C#, .NET e JSON.invia datetime dall'app iphone a un servizio web
Nella mia applicazione iPhone sto formattazione della data come:
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];
sto ottenendo l'errore:
There was an error deserializing the object of type DashboardDataContract.Contracts.DashboardInputParams. DateTime content '2013-04-04T12:00:00Z' does not start with '/Date(' and end with ')/' as required for JSON.'.
ho provato la formattazione diverso di date. Qualcuno potrebbe aiutarmi in questo senso?
Molto bello e semplice! – user2068793
Funzionerà su tutti i fusi orari? – Anupdas
Se si desidera aggiungere il fuso orario, è necessario il formato/Data (xxxxxxxxxxxx + aaaa)/dove yyyy è il fuso orario ad esempio:/Data (12345678954 + 0000) / –