Ich habe folgendes ProblemRestSharp konvertiert Datumsangaben in UTC
Ich benutze RestSharp für den Zugriff auf meine API. Aber wenn ich eine DateTime sende, scheint es in UTC konvertiert zu werden. Ich sende '10 .06.1991 00:00 'und die API bekommt '09 .06.1991 22:00'
Also, ich würde immer 2 Stunden hinzufügen müssen, wenn meine API ein DateTime-Objekt bekommt?
Ich überprüft die JSON RestSharp sendet an die API.
public class Test
{
public int IntProperty {get;set;}
public string StringProperty {get;set;}
public DateTime DateTimeProperty {get;set;}
}
Mein Ziel ist
Test t = new Test{ IntProperty=3, StringProperty="string", DateTimeProperty=new DateTime(1991,06,10) }
wenn ich das Objekt über RestSharp bin das Senden, das JSON meine API erhält
ist{
"IntProperty":3,
"StringProperty":"string",
"DateTimeProperty":"09.06.1991 22:00:00"
}
Jede Idee, was ich tun könnte? Danke
Ist das das gleiche Problem wie https://github.com/restharp/RestSharp/issues/691? – mjwills