110,549
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace CS.sql_manage
{
public partial class TestCode : Form
{
public TestCode()
{
InitializeComponent();
}
private void TestCode_Load(object sender, EventArgs e)
{
// DateTime dt = DateTime.Now;
// this.textBox1.Text = string.Format("{0:yyyyMMdd}",dt);
//this.textBox1.Text = dt.ToString("yyyyMMddHHmmss");
DateTime now = DateTime.Now;
byte[] bts = BitConverter.GetBytes(now.ToBinary());
DateTime rt = DateTime.FromBinary(BitConverter.ToInt64(bts, 0));
this.textBox1.Text = rt.ToString("yyyyMMddHHmmss");
}
}
}