I would like to know many minutes between 2 dates?
Example : Now - tommorow at the exact time would return me 1440.
DateTime dt1 = DateTime.Now;
DateTime dt2 = DateTime.Now.AddDays(1);
int diff = dt2.Subtract(dt1).TotalMinutes;
Look at the TimeSpan class.
DateTime date1 = DateTime.Now;
DateTime date2 = DateTime.Now.AddDays(1);
TimeSpan diff = date2.Subtract(date1);
Console.WriteLine(diff.Minutes);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With