Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- /*
- * Write a program that reads a date and time given in the format: day.month.year
- * hour:minute:second and prints the date and time after 6 hours and 30 minutes
- * (in the same format) along with the day of week in Bulgarian.
- */
- namespace ReadDateTimeAddHoursPrint
- {
- class ReadDateTimeAddHoursPrint
- {
- static void Main()
- {
- Console.WriteLine("Please enter the date and time (dd.mm.yyyy hh:mm:ss): ");
- DateTime date = DateTime.ParseExact(Console.ReadLine(), "dd.MM.yyyy HH:mm:ss", CultureInfo.InvariantCulture);
- date = date.AddHours(6.5);
- System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("bg-BG");
- Console.WriteLine(date + " " + date.DayOfWeek);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement