Solved

Date Format on IIS/Win2000/asp

Posted on 2002-03-10
3
171 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

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…
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now