Solved

Date Format on IIS/Win2000/asp

Posted on 2002-03-10
3
181 Views
Last Modified: 2009-07-29
Hi,

I am developing using ASP.

I am aware of a problem with date format where you cannot predict whether the year format coming back form ASP/IIS is going to give 4 characters or just 2.

I have taken measures to ensure this does not cause me any difficulties

However, I have just switched from PWS and win 98 as my off-line dev environment, to win 2000/IIS5.

The problem is that running my web application locally I am seeing the date in the format mm/dd/yyyy when, being in the UK I would like to see it dd/mm/yyyy.

As stated before, the year format is coded for, but I suspected the dd/mm format could be set on the machine.

In control panel, Regional settings I have the correct date format displayed, soi I thought it must be set somewhere in my IIS ... anyone any clues.

Many thanks


0
Comment
Question by:jonesgj
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
AndresM earned 100 total points
ID: 6855053
See if this helps:
INFO: Behavior of Date/Time Format Differs When Accessed from Active Server Pages (Q306044)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q306044
0
 

Author Comment

by:jonesgj
ID: 6859764
I have tried modifying the registry as suggested with no success.

I used the paras referring to IIS5/SP2:

-----------------
IIS 5.0 (Windows 2000 Service Pack 2 and Later)
In Windows 2000 Service Pack 2 (SP2), the default behavior is as mentioned above. However, you can also customize the settings: you can either change the base OLEAUT component or change IIS so that it can enable this change in OLEAUT.

You can set the registry entry for OLEAUT globally. This does not override a process that explicitly sets the option by using the exposed call. Thus, if you set the following IIS value, you override the OLEAUT setting.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLEAUT
VarConversionLocaleSetting = 0,1,2 (DWORD)
NOTE : The OLEAUT key may not exist. If it does not, you must create the key first.

You can also set the value for IIS, which also overrides any global setting for OLEAUT. Moreover, IIS will call this OLEAUT application programming interface (API) whether or not the registry entry is set.
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\InetInfo\Parameters
SetVarConversionLocaleSetting = 0,1,2 (DWORD)
The values of 0, 1, and 2 are the same for OLEAUT and IIS and are defined as follows:
0 - The default behavior, as stated earlier. This format is completely random. It is based on the last user or process that set the cache.
---------------------

Normally I wouldnt be in the registry, so I hope I have made the alteration/additions correctly.

I am logged on as the administrator whose locale settings are correct. I am accessing my asp pages using ie5 on my local (PWS) server.

0
 

Author Comment

by:jonesgj
ID: 6878405
Thanks AndresM.

I used the snippet of code in the asp.net section in my first asp page that loads, and this seems to set the date to my local settings ... its works.

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question