Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using TestInput;
- /*
- from Lesson 6 of C# console programming tutorial series at following URL:
- http://williammillerservices.com/windows-c-console-programming/
- tests helper method IsDate() found in tester3.cs
- GitHub gist -> https://gist.github.com/kyrathasoft/076d1dcabc173536f8d345c43d177eff
- Pastebin.com -> https://pastebin.com/8Ud4GbwP
- */
- namespace MyNamespace
- {
- class MyClass
- {
- static void Main(string[] args)
- {
- DateTime dt2000 = new DateTime(2000, 1, 1);
- DateTime dt2001 = new DateTime(2004, 7, 15);
- int iDiff = Tester.GetDifferenceInYears(dt2000, dt2001);
- string sMsg = "Years between dates ";
- sMsg += dt2000.ToShortDateString() + " and ";
- sMsg += dt2001.ToShortDateString() + " = ";
- sMsg += iDiff.ToString();
- Console.WriteLine(sMsg);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement