C# correct method to compare 2 date time
Compare datetime as you would compare numbers such as
DateTime expiration_date = newVer.License.Status.Expiration_Date;
DateTime currentDateTime = DateTime.Now;
if( expiration_date < currentDateTime)
{
// expired
}
If you need only date and not time then use
DateTime expiration_date = newVer.License.Status.Expiration_Date.Date;
DateTime currentDateTime = DateTime.Now.Date;
You can also use day difference of two date.
int daydiff = (int)((currentDateTime - expiration_date).TotalDays)
Your question has a two-part answer. There may be something easier, but:
First, convert your string to a DateTime object. The DateTime class has several methods to help with this. Try ParseExact.
Then, convert the DateTime object to a Unix timestamp.
Now, you have two long ints, that you can compare, and convert the int comparison to another DateTime, and take things from there.