The now () function called in the ASP program displays the problem in the morning and afternoon.

Source: Internet
Author: User

ASPProgramIn, when the function now () is called, the display time is always like "08:12:56" and "Morning" and "Afternoon". The solution and the final solution are as follows:
This is usually because the server is set in this way. First, view the time format: double-click the time in the taskbar, in the pop-up "time and date", the words "Morning and afternoon" are displayed, so proceed to the next step;
Open the control panel, select "region and language options", select Custom in "region options", select the "time" tab, and set the time format to "H: mm: SS (24-hour time), clears the values after the following AM and PM symbols, and click OK to save the settings;
In this case, the "time and date" is opened, and the words "Morning" and "Afternoon" are no longer displayed in the time, so proceed to the next test;
After IIS is restarted, execute the ASP function now (). I am very disappointed with the result, but the word "Afternoon" is displayed. This is not the problem now, it should be that the time set by the system region is not used;
Force ASP time to use the time format in Region settings. The method is as follows: Open the Registry Editor and enter HKEY_LOCAL_MACHINE/software/Microsoft/to create oleaut items, create a DWORD Value named "varconversionlocalesetting" under this item, set data to 2, and exit the Registry Editor after the setting is complete.
After IIS is restarted, test the ASP function now () again. Now, the "Morning" and "Afternoon" are no longer displayed.

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.