DiffDays

edit

DiffDays

Namespace

Summary== Returns a double indicating the number of days between two dates (past is negative) ==Example==var days=DateTime.Now.DiffDays(DateTime.AddDays(3)); ==Unit Test

public void DiffDaysShouldReturn3ForDateTimeNowAnd_AddDays3() { var today = DateTime.Now; var then = DateTime.Now.AddDays(3); var diff = today.DiffDays(then); Assert.Equal(-3, diff); }

Comments

SubSonic 3.0 implements this as an extension on System.DateTime - 2.x uses a static method on SubSonic.Sugar.Dates.