C# 日期格式化 DateTime.Now.ToString("{0:yyyy-MM-dd HH:mm:ss}"); //返回string类型 string.Format("{0:yyyy-MM-dd HH:mm:ss}",DateTime.Now);