C# 日期格式输出毫秒

string str = "2023-06-15 10:36:58.036"; //该格式的时间字符串支持直接转成DateTime
DateTime dt = Convert.ToDateTime(str);
str = dt.ToString("yyyy-MM-dd HH:mm:ss.fff"); //输出毫秒的格式
posted @ 2023-11-29 10:17  乐 乐——1128  阅读(1415)  评论(0编辑  收藏  举报