Member_2_7967608
asked on
C# DateTime format
Hi all,
Can we represent DateTime in C# in below format. I haven't found this format in .Net
2016-08-31T15:00:00-04:00
Here is -4 is UTC offset. The time is local EST time
I want to serialize the DateTime to Json in the above format. How do we convert to this format.
Thanks in advance
Can we represent DateTime in C# in below format. I haven't found this format in .Net
2016-08-31T15:00:00-04:00
Here is -4 is UTC offset. The time is local EST time
I want to serialize the DateTime to Json in the above format. How do we convert to this format.
Thanks in advance
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is my code. How can I set the formatter here. The datetime is coming from UI as "req2".
var request = new RestRequest("api/ACSSchedu le/", Method.POST) { RequestFormat = DataFormat.Json };
request.JsonSerializer = new RestSharp.Newtonsoft.Json. Newtonsoft JsonSerial izer();
request.AddBody(req2);
var response = Execute(request, _client);
var request = new RestRequest("api/ACSSchedu
request.JsonSerializer = new RestSharp.Newtonsoft.Json.
request.AddBody(req2);
var response = Execute(request, _client);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Formatting works with Newtonsoft Json serailizer
Open in new window