IIS Time format settings

Source: Internet
Author: User
Tags locale

IIS Time Format adjustment:

(Resolved) Today, when using IIS7 to find a question about the time format, when I use the now () time function in ASP, the date is separated by "/" instead of "-", which makes me make mistakes when I run the program, and then finally find the solution by research.

The operating system I use here is Winodws Vista Ultimate Service Pack 1, and the result of using the now () time function in ASP is as follows:

2009/3/17 8:11:51

And I want the result is 2009-3-17 8:11:51, do not know why in the IIS7 time format to/to distinguish, if a master know please leave a message, but eventually I modified the registry to solve the problem, the following methods:

1, start → run → input regedit, open Registry Editor, find Hkey_users\ in turn. DEFAULT\Control Panel\International

2, find the Sdate item in the right window, change its value to-; Sshortdate, and change its value to yyyy-m-d,

3, restart IIS, start → run → input iisreset

Unresolved in the following ways:

Since the installation of the Tomato Garden XP, I found a lot of problems.

The first is that several local sites do not function correctly, prompting the error message is a time format error. I could have done it before. Look, it seems to be a more "morning/Afternoon" string.

The relevant information was found on the network as follows:

Modify the Registration Form

hkey_users/. Default/control panel/international

Hkey_current_user/control panel/international

Itime = 1

The corresponding key value is Hkey_local_machine/software/microsoft/oleaut (OleAut may not exist, create one yourself)

Create a DWORD value under this key varconversionlocalesetting = 2

Note: The DWORD value is called "Double-byte value" in the Chinese Registry Editor.

Restart the computer after the operation is complete ... Ok.

Other: Why is this DWORD value 2? Actually, he has a 0,1,2 value.

0-The default value is the current value.

1-defaults to the system defaults in the Hkey_users/.default/control panel/international registry hive, which is equivalent to the current value if your system date format is not standard.

2-This format is enforced to use the system default locale.

Tried it, the above method is not good. Do not know is not I do not understand the essence of it.

Think of yourself used to optimize the master, in front of the date added such as "good study" words, is not in the optimization master can also solve this problem.

In the personality settings inside Delete "morning/afternoon", restart.

It's still not working.

But I finished it after all, otherwise I wouldn't have said a lot of nonsense.

Control Panel-date, time, language, and locale-change formats for numbers, dates, and times – Regional Options-Custom – time

Time format: HH:mm:ss (specific meaning, above)

Date format: yyyy-m-d

You can try the other format to see the effect. The following section of code is used to detect the format specification or not.

IIS time Format validation script:

<!----Test time Begin---->

<%

Tnow = Now (): Oknow = CStr (Tnow)

If Oknow <> year (tnow) & "-" & Month (Tnow) & "-" & Day (Tnow) & "" & Hour (Tnow) & ":" &A mp Right (FormatNumber (minute (Tnow)/100,2), 2) & ":" & Right (FormatNumber (second) tnow), 2)/100,2 then = Oknow & "(date format is not standard)"

%>

Server time: <%=oknow%>

<!----Test time End---->

------------------------------------------

2006.09.06

Again encountered this problem, after testing, found. The above is not valid by setting in the "date, time, language, and locale" settings.

Using the above mentioned:

The corresponding key value is Hkey_local_machine/software/microsoft/oleaut (OleAut may not exist, create one yourself)

Create a DWORD value under this key varconversionlocalesetting = 2

Restart IIS, OK.

To restart IIS:

Start-run

net stop IISAdmin

IISReset

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.