Advertisement
VladoG

[PB] - Simple Calculations - 13-1000DaysAfterBirth

Feb 5th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _13_1000DaysAfterBirth
  8.     {
  9.     class Program
  10.         {
  11.         static void Main(string[] args)
  12.             {
  13.             string format = "dd-MM-yyyy"; // DATE Format
  14.             //Console.Write("ENTER Date: ");
  15.             var dateIN = DateTime.ParseExact(Console.ReadLine(), format, null); // Get Date from Console
  16.             //var dateIN = DateTime.ParseExact(Console.ReadLine(), format, CultureInfo.InvariantCulture); // Get Date from Console
  17.  
  18.             // Console.WriteLine("ENTER: " + dateIN);
  19.             var date1000 = dateIN.AddDays(1000 - 1);
  20.  
  21.             //DateTime date1000 = dateIN.AddDays(1000 - 1);
  22.             //Console.WriteLine("OUT: " + date1000.ToString(format));
  23.             Console.WriteLine(date1000.ToString(format));
  24.  
  25.             // FOR EXAMPLE:
  26.             //DateTime today = DateTime.Now;
  27.             //DateTime answer = today.AddDays(36);
  28.             //Console.WriteLine("Today: {0:dddd}", today);
  29.             //Console.WriteLine("36 days from today: {0:dddd}", answer);
  30.             }
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement