Advertisement
Guest User

Untitled

a guest
Dec 17th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. nextdate1='2014-12-20'
  2.  
  3. today `='2014-12-18'`
  4.  
  5. DateTime nexdate1 = dr.GetDateTime(2);//gets from database. I checked and the value is correct
  6. DateTime today = DateTime.Now;
  7. TimeSpan nextdate = nexdate1.Subtract(today);
  8. //TimeSpan nextdate = nexdate1-today;//This method also applied
  9. int difference = nextdate.Days;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement