Link to home
Start Free TrialLog in
Avatar of jonesgj
jonesgj

asked on

Date Format on IIS/Win2000/asp

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


ASKER CERTIFIED SOLUTION
Avatar of AndresM
AndresM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jonesgj
jonesgj

ASKER

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.

Avatar of jonesgj

ASKER

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.