Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace oraperc
- {
- class Program
- {
- static void Main(string[] args)
- {
- DateTime[] datumok = { DateTime.Now, DateTime.Now.AddHours(8), DateTime.Now.AddSeconds(77) };
- foreach (var item in datumok)
- {
- Console.WriteLine(MyExtensions.oraperc(item));
- }
- Console.ReadKey();
- }
- }
- static class MyExtensions
- {
- public static string oraperc(DateTime d)
- {
- return d.Hour.ToString("D2") + ":" + d.Minute.ToString("D2");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement