두 날짜 사이의 간격 확인(Visual C#)

Posted by Albert 3677Day 20Hour 7Min 10Sec ago [2015-03-27]

DateTime oldDate = new DateTime(2002,7,15);
DateTime newDate = DateTime.Now;

// Difference in days, hours, and minutes.
TimeSpan ts = newDate - oldDate;
// Difference in days.
int differenceInDays = ts.Days;

Console.WriteLine("Difference in days: {0} ", differenceInDays);

참고주소: https://msdn.microsoft.com/ko-kr/library/aa287590(v=vs.71).aspx



LIST

Copyright © 2014 visionboy.me All Right Reserved.