Solve the Problem of DateTime format in ASP

Source: Internet
Author: User

Recently maintainedASPAn error occurred while inserting User Logon logs into the database during the project. Take a closer look ~~ Why?

Insert into userLog (userid, logtime, ip) values (1, '2017-10-18 55', '2017. 0.0.1 ')

So I can find the reason, no matter how I set the regional language,ASPInNow ()They don't even listen to me.DateTime format Error

This confused me, So I went online to find it ~~

The conclusion is as follows:The DateTime format of ASP is not affected by the regional language settings,Unless you change the Registry

The details are as follows:

In the registry
[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ OLEAUT]

Modify

VarConversionLocaleSettingThe field property value is 2.

 

If you are too lazy, copy the following information, save it as the **. reg file, and double-click it to import the registry:

 

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ OLEAUT]
"VarConversionLocaleSetting" = dword: 00000002

 

Note: You must restart IIS. If not, restart Windows.

 

Related Article

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.