I have this DateTime object:
model.Model.Results.FloatingComponent().Schedule.ScheduleRows[0].Payment.FromDate.AdjustedDate
How to find out how many days in the future if this happens in the future?
TimeSpan delta = Foo.AdjustedDate - DateTime.Now; if(delta.Days > 0) { //... }
Edit:
Based on @Gabe, comment on a version here that only looks at days:
TimeSpan delta = Foo.AdjustedDate.Date - DateTime.Today; if(delta.Days > 0) { //... }
DateTime mydate = .... TimeSpan span = mydate.Subtract(DateTime.Now); // then use span.Days;
int days = (futureDate - DateTime.Today).Days;
Source: https://habr.com/ru/post/1796134/More articles:How a website should handle a database crash - databaseNeed a sound engine or audio engine for iOS - iosHAML syntax error "Waiting for $ end" - ruby-on-railsFailed to load Main-Class manifest attribute from - javaRecommended approaches for getting my code included? - c ++Redirecting problems - c #Can I split more than one file at a time using subversion and Beyond Compare? - svnC # and SQL LIKE: "%" works as a one-character pattern - c #N-Layered ASP.NET app: one class library for all my layers or one class library for each layer? - c #Как вызвать событие APPCRASH в приложениях Delphi? - delphiAll Articles