I have a string that looks like 5/27/2015 4:49:54 AM
I need it to be in this format: 2015-27-05T04:49:54+08:00
I tried converting it like so but it throws an error:
var convertedDate = DateTime.ParseExact(originalDate, "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",
new CultureInfo("en-US", true));
I also tried converting it like this but it doesn't seem to do anything, convertedDate ends up being the same as originalDate:
var convertedDate = String.Format("{0:u}", originalDate);