Hello everyone,
My job is to take a date from XML file annotation, take a number of days from another annotation and then add these days to the previous date.
I have a problem mainly with a variable type - the XML annotation is a string, but when I try to convert the “dd/mm/yyyy” format of XML annotation to the date type - it gives me a different date. Then, how to change a number of days (string) into a double variable, which I have to put inside AddDays()?
I tried the following:
date_var=DateTime.ParseExact(date_string,“dd/mm/yyyy”,System.Globalization.CultureInfo.CurrentCulture)
date_var1=date_var.AddDays(no_of_days.ToDouble).ToShortDateString
But it doesn’t work. Could you tell me why?