How to determine if a date is within 180 days?
I played with DateTime.Compare below and used date1 +180 days (date1 - August 28, 2009 13:12)
DateTime.Compare(**date1**.AddDays(180), now)
Is it correct?
thanks
Jamie
DateTime.Now.Subtract(dt1).Days <= 180
if (Math.Abs(DateTime.Now.Subtract(date1).Days) <= 180) { ... }
This will let you know if date1 is within 180 days IN THIS DIRECTION right now - in the past or in the future. If you only need in the past, go to Developer Art .
date1
Source: https://habr.com/ru/post/1302145/More articles:Increase IIS ASP.NET 3.5 Stack Size - iisEDITBIN gives LNK1104 (cannot open file) - stack-overflowHow does a .NET program behave differently at startup and without debugging in Visual Studio? - .netClient library or AJAX Control toolkit? - ASP.NET - jqueryIs this loop cycle endless? - c #How to use jar files without package information? - javaPython and curl questions - pythonPlease clarify my understanding regarding the object and the link, and the type of value is current? - memory-managementJava Interfaces ... Dynamic or Static Memory? - javaIncrease text box size - javaAll Articles