In the development of. Net Applications Program When writing data to access, because access converts the data type of time and date, it is inconsistent with the format of Chinese year, month, and day, resulting in an application error. So I used this knowledge and found it online. Article
Coding best practices using datetime In the. NET Framework, on http://msdn2.microsoft.com/en-us/library/ms973825.aspx. The introduction should be comprehensive enough, but for general applications, you only need to set
System. datetime. Now. tostring ( " Yyyy-mm-dd hh: mm: SS " );
You can.
It's just a wake-up here. This can be done when the date and time format is applied, so there will be no problems. However, if you convert the specified format to the datetime format, the conversion problem also occurs. For example:
Datetime dt = Convert. todatetime ( " 2007-05-06 " );
// It translated it into 6.5. 2007