. Net core-format conversion problem,. netcore

Source: Internet
Author: User

. Net core-format conversion problem,. netcore

Recently, the project was migrated from. net to the. net core environment. After the migration is completed, the project was released on the Windows platform for testing. All functions can run normally.

To ensure that the project can run normally in the official environment, perform the Linux environment deployment (Centos7) prerelease in advance and perform the basic code test after the prerelease,

The log shows a string-to-datetime error. The same Code and test cases should not have different results !!!???~

~ I think there are still some differences between Linux and Windows. Will it be a problem with the running environment? After debugging, I found that in linux, The datetime is directly tostring or + operation with stirng,

The results are inconsistent with those in Windows. In Windows, the default format is 21:55:12, while in linux, the keyword AM/PM/AM is included,

However, if you convert the result to the date format using the DateTime. Parse () function, an error is returned !!!

This! It should be a bug in. net core sdk (linux!

Therefore, we recommend that you set the format to dt. ToString ("yyyy-MM-dd HH: mm: ss ");

This article was published on February 17,. You are welcome to join the discussion.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.