C# Program to get Hour:Minute:Second

Rajnilari2015
Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 1289
using System;

namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
var hourMinuteSecond = DateTime.Now.ToString("HH:mm:ss");
Console.WriteLine("Hour:Minute:Second : {0}", hourMinuteSecond);
Console.ReadKey();
}
}
}


Result
------

Hour:Minute:Second : 09:38:53

Comments or Responses

Login to post response