How can I calculate if you spent 1 day, ignoring the hours. Explaining, it would look something like this:
I have a date 2017-09-09 11:45:20
, normally it would have been 1 day, when the 11:45 arrived the other day, however I would like it to count as 1 day as soon as it gives 00:00:00
.
Even though I have the following date 2017-09-09 23:59:59
and now it was 2017-09-10 00:00:00
. I literally just went 1 minute , but I want it to count as 1 day .
I tried to do this, but it returned me 0:
// mês/dia/ano hora:min:seg
// questData.CompletedDate 09/09/2017 11:45:20
// DateTime.Today 09/10/2017 00:00:00
int totalDays = (int)DateTime.Today.Subtract(questData.CompletedDate).TotalDays;
How could I do this in C #?