Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _4_DifferenceBetweenDates
- {
- class Program
- {
- private static int CalculateDifferenceInDays(DateTime firstDate, DateTime secondDate)
- {
- TimeSpan difference = secondDate-firstDate;
- return int.Parse(difference.TotalDays.ToString());
- }
- static void Main(string[] args)
- {
- DateTime firstDate = DateTime.Parse(Console.ReadLine());
- DateTime secondDate = DateTime.Parse(Console.ReadLine());
- Console.WriteLine(CalculateDifferenceInDays(firstDate, secondDate));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement