Solved

Date Format on IIS/Win2000/asp

Posted on 2002-03-10
3
178 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server 2008 Server 2003 Server 2000 12 644
How to change folder redirection to a new server 5 738
windows 2000 - Enable wifi 7 142
Windows 2000 48-bit LBA 13 19
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…
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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