Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ASP pages use Time/Date format based on user that is logged on


View products that this article applies to.

Symptoms

When you view an ASP Web page that returns the date, the format that is displayed may be dependant on the last person that was logged on to the computer. This is actually based on the last time that the cache was "touched" but may be affected by other events that reset the cache. Note that this problem may also affect other regional setting formats.

↑ Back to the top


Cause

To improve performance in Microsoft Windows NT, the regional settings are cached, and this cache is used to determine how to format Date and Time strings. Because this is done by a common component, Oleaut32.dll, you receive the format of the last-cached entry. This behavior can result in an inconsistent format that is based on which user last updated the cache.

↑ Back to the top


Resolution

Service Pack Information

To resolve this problem, obtain the latest service pack for Microsoft Windows 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
260910 How to Obtain the Latest Windows 2000 Service Pack

Hotfix Information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language. The English version of this fix should have the following file attributes or later:
   Date        Time    Version       Size     File name
   --------------------------------------------------
   02/13/2001  06:58p  2.40.4517.0   143,632  Asycfilt.dll
   02/13/2001  06:58p  2.40.4517.0   626,960  Oleaut32.dll
   02/13/2001  06:58p  2.40.4517.0   164,112  Olepro32.dll
   02/13/2001  05:39p  2.40.4517.0    16,896  Stdole2.tlb
   02/13/2001  05:39p  2.40.4517.0   123,152  Iisrtl.dll
				

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft Windows 2000 Service Pack 2.

↑ Back to the top


More information

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

For additional information about how to install Windows 2000 and Windows 2000 hotfixes at the same time, click the article number below to view the article in the Microsoft Knowledge Base:
249149 Installing Microsoft Windows 2000 and Windows 2000 Hotfixes
The fix for this problem requires some registry entries for the default behavior to change. This fix affects two components, OLEAUT and IIS. The first change is for the base OLEAUT component, and second is for IIS so that it can enact this change in OLEAUT. There is now a call exposed by OLEAUT that allows you to set the behavior for each process.

The registry entry for OLEAUT can be set globally. This does not override a process that explicitly sets the option by using the exposed call, so setting the following IIS setting overrides the OLEAUT setting.

NOTE: The OLEAUT key may not exist, and if it does not, you must create the key first.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLEAUT
VarConversionLocaleSetting = 0,1,2 (DWORD)

You can also set the value for IIS which, again, overrides any global setting for OLEAUT. Moreover, IIS will call this OLEAUT 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 defined as follows and are the same for OLEAUT and IIS:

0 - Default behavior as it exists right now. This format is completely random. It is based on the last user or process that set the cache.

1. Format is based on the current identity of the thread requesting these values. This is based on the identity of the thread that makes the call to the OLEAUT32.dll. In the case of IIS, it is the Authenticating User profile settings (since IIS impersonates the authenticating user by default). If the Authenticating user's profile doesn't exist/ or is not loaded into the registry, it defaults to System Default settings from the following registry hive.
HKEY_USERS\.default\Control Panel\International
You can configure your web application in such a way that the impersonated user on a thread requesting these formats is the same user at all times. In this way, you can expect a consistent format.(For example: using Anonymous access on an ASP page would always result in the same date format irrespective of who is logged on to the system and also irrespective of the identity of the actual user requesting the page.)

2 - Format is forced to use the system default regional settings. The system default settings are set for a computer at reboot. The default system settings can be modified by clicking Set Default... in the Regional Settings tool in Control Panel. You can then choose a new locale to be the default locale, and you should then restart your computer. In this case, the date format is not read from the registry but from the Locale.nls file for that locale.

NOTE: Changing the default locale changes all regional settings (time, money, date formats etc.). There is no way to modify a specific setting with in the locale.

↑ Back to the top


Keywords: kbautohotfix, kbhotfixserver, kbbug, kbenv, kbfix, kbqfe, kbui, KB271587

↑ Back to the top

Article Info
Article ID : 271587
Revision : 11
Created on : 2/21/2007
Published on : 2/21/2007
Exists online : False
Views : 514