Get the App
SLTechnology News&Howtos  ›  Development  › 

How ASP.NET Core returns Json DateTime format

Shulou Source: shulou.com Published: 2022-06-03 13:24:36 11月14日 Update

Editor to share with you how to return ASP.NET Core Json DateTime format, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

When ASP.NET Core returns Json format, how to customize its format if there is a DateTime type in the returned data? The configuration is as follows:

Services.AddMvc (). AddJsonOptions (opt = > {opt.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm";}); the above is all the content of the article "how ASP.NET Core returns Json DateTime format". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Format article content not much most data time more knowledge type industry information information channel channel reference learning help configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Tech Info MariaDB Linux Shulou Information