顺序结构显示日期与时间

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 顺序结构时间日期
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
this.textBox1.Text = "今天的日期是:" + DateTime.Now.ToLongDateString();

}

private void 查询时间_Click(object sender, EventArgs e)
{
this.textBox1.Text = "现在是北京时刻:" + DateTime.Now.Hour.ToString() + "点" + DateTime.Now.Minute.ToString() + "分" + DateTime.Now.Second.ToString() + "秒";

}
}
}

 

 

 

posted @ 2017-05-23 22:15  删除回忆的星星  阅读(116)  评论(0编辑  收藏  举报