I download a json string from a website including a DateTime. Using this code:
using (HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse())
{
using (Stream responseStream = httpWebResponse.GetResponseStream())
{
using (StreamReader streamReader = new StreamReader(responseStream))
{
value = streamReader.ReadToEnd();
}
}
}
authResponse = JsonConvert.DeserializeObject<Class1.Response>(value);
The Json Class looks like this:
public Response()
{
this.key = ""
this.valid_until = "";
this.xyz = "";
}
The String looks like this:
{
"key":"1424152",
"time_date":"2021-09-19 20:35:17",
"xyz":"Working"
}
Now before I Deserialize it I want to change the Date Time (add 2 days to it) in that string. How would I approach that?