C#时间格式转换为时间戳
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
开发工具与关键技术: C#
作者:薛裕全
撰写时间:2022/5/28
DateTime的Tostring方法使用
Console.WriteLine("ToShortDateString:" + DateTime.Now.ToShortDateString());
Console.WriteLine("ToLongDateString:" + DateTime.Now.ToLongDateString());
Console.WriteLine("ToShortTimeString:" + DateTime.Now.ToShortTimeString());
Console.WriteLine("ToLongTimeString:" + DateTime.Now.ToLongTimeString());
Console.WriteLine(DateTime.Now.ToString());
Console.WriteLine(DateTime.Now.ToString("t"));
Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"));
Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ms"));
Console.WriteLine(DateTime.Now.ToString("d")); //格式: 2010-10-22
Console.WriteLine(DateTime.Now.ToString("D")); //格式: 2010年10月22日
Console.Writ