Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void runTimeConverter()
- {
- double arrivalTime;
- arrivalTime = getArrivalTime();
- string time = DateTime.ParseExact(arrivalTime, "HHmm", CultureInfo.CurrentCulture)
- .ToString("hh:mm tt");
- Console.WriteLine("Equals " + time);
- }
- static double getArrivalTime()
- {
- Console.WriteLine
- ("Enter time in 24 hour format to convert to 12hour");
- string timeSelected = Console.ReadLine();
- int timeInput = int.Parse(timeSelected);
- return timeInput;
- }
- using System.Globalization;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement