DateTime.Now 在.netcore下的格式问题
public static void Main(string[] args) { CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("zh-CN", true) { DateTimeFormat = { ShortDatePattern = "yyyy-MM-dd", FullDateTimePattern = "yyyy-MM-dd HH:mm:ss", LongTimePattern = "HH:mm:ss" } }; CreateHostBuilder(args).Build().Run(); }
原文链接:https://blog.csdn.net/shanghaimoon/article/details/116122021