Wednesday, November 9, 2011

Calculate difference between 2 dates in C#

DateTime objD1 = DateTime.Now;
DateTime objD2 = DateTime.Now.AddDays(10);

TimeSpan t = objD2 - objD1;
double iNoOfDays = t.TotalDays;

No comments:

Post a Comment

Your project is not referencing the "MonoAndroid,Version=v8.1" framework. Add a reference to "MonoAndroid,Version=v8.1" in the "frameworks" section of your project.json, and then re-run NuGet restore.

I had  the same problem. Reason: file obj/project.assets.json target "MonoAndroid,Version=v7.1" when my project target androi...