I am writing an api that will talk with a third party website. It expects the date in a format of 2016-09-24T00:00:00Z with only the date portion changing (the time is always 00:00:00Z regardless of time or timezone).
I am using Angular to convert it (and then calling toString()) to the correct format and am calling JSON.stringify on it and then passing it to my web method.
In my web method I call to convert the data to a string.
var registrationExpiryFull = indata["registrationExpiryFull"].ToObject<string>();
However after that line executes registrationExpiryFull
has formatted the date from 2016-09-24T00:00:00Z to 09/23/2016 00:00:00. The first picture shows the string that is coming into the method and the second picture shows the formatted date.
Why does my string that I pass in get converted to another string?