3
I created a Datetime with some values started in the constructor, but when I add a Timespan with some values, it does not add together with the date.
I am using the Datetime method to add a Timespan, but it is not working because the time is reset, there is another way to do beyond this ? Or what I’m doing wrong?
static void Main(string[] args)
{
var timeSpan = new TimeSpan(5,5,0);
var data = new DateTime(2017,8,5);
data.Add(timeSpan);
Console.WriteLine(data);
Console.ReadKey();
}
It worked here: https://dotnetfiddle.net/2R6rvB
– Maniero