Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- using System.Linq;
- namespace DayOfWeek
- {
- class Program
- {
- static void Main(string[] args)
- {
- CultureInfo provider = CultureInfo.InvariantCulture;
- Console.WriteLine("Enter a date in the format dd-mm-yyyy: ");
- string input = Console.ReadLine();
- DateTime dateTime = DateTime.ParseExact(input,"dd-MM-yyyy",provider);
- string dayOfWeek = dateTime.DayOfWeek.ToString();
- Console.WriteLine("The day of week on this day was: " + dayOfWeek);
- }
- }
- }
Add Comment
Please, Sign In to add comment