Display current time only

Satyapriyanayak
Posted by Satyapriyanayak under C# category on | Points: 40 | Views : 818
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Display_current_time
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btn_time_Click(object sender, EventArgs e)
{
DateTime dt = DateTime.Now;
MessageBox.Show(dt.ToString("T"));
}
}
}

Comments or Responses

Login to post response