Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP VBScript UK Date Format Default

Posted on 2003-11-10
9
Medium Priority
?
595 Views
Last Modified: 2012-08-14
I want my ASP vbscript functions to always return dd/MM/yyyy british formats by default.

I have a page with the following code
<%
  response.write now()
%>
Sometimes it returns 11/6/2003 11:17:55 AM and sometimes 06/11/2003 11:17:42 (I also get the same scenario with currencies switching between £ and $ which suggests to me IIS switching Regional Settings). I can have the same page opened in separate browser windows within seconds of each other showing the different formats.

I have sifted through newsgroups for help, these are the things I have tried to no avail
*  The registry key HKEY_USERS/.Default/Control Panel/International is set correctly  (I understand that IUSR | IWAM account uses this)
* I remotely log on as Administrator. My regional settings are UK English, The Set Default is UK English (although it was US English).
* There are two other profiles under HKEY_USERS/ both of these have UK settings, as is the case with HKEY_CURRENTUSER
* I added a key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLEAUT
VarConversionLocaleSetting = 2  and HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\InetInfo\Parameters SetVarConversionLocaleSetting = 2  which should force IIS to use system default Regional Settings

I have since rebooted, yet still the problem persists. I have even explicity set the Session.LCID = 2057 in the global.asa session and application startup events. However, I don't want a coding solution as I don't see why it should require one.

Server config is Windows2000 Advanced Server, Service Pack 4. IIS version 5.0

0
Comment
Question by:macdpa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9714795
YOu might want to consider using the LCID code at the top of your page:

http://www.webwizguide.info/asp/faq/date_time_settings.asp

Fritz the Blank
0
 

Author Comment

by:macdpa
ID: 9715492
I have already tried using the Session.LCID = 2057 as follows in the global.asa to no effect

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Session_OnStart
      Session.LCID = 2057
End Sub

</SCRIPT>

Having it in the actual page does seem to have the desired effect. However as I stated in the original post, I wasn't wanting after a coding solution here. Perhaps its better suited to the IIS area ?
0
 
LVL 2

Expert Comment

by:turbosig
ID: 9715886
on your server, go to control panel --> regional date & time / language options (syntax will depend on your OS).

Change it there.  Then it will always be in UK format.

remember though, if someone from let's say the US is on the site and you have text fields where they type in the "date" you will have to take this into acount.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:macdpa
ID: 9716217
This was the very first thing that I checked. As I say above I can only log on remotely (and do so as Administrator). Going through the control panel Regional Settings Dates are set as UK based.

I understand however, that IIS authenticates a web user as using the IUSR_ and/or IWAM_ accounts, and therefore I thought perhaps these accounts were set up with different regional settings. As these aren't real accounts you can't actually log in to these account and change their regional settings in the control panel like a normal user. So how do I check the regional Settings for these accounts ? As well as HKEY_USERS/.Default/Control Panel/International I checked the two other profiles that existed in the registry under the HKEY_USERS/ hive, they both have UK dates and locales settings specified.

 
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9716263
I know that it wasn't what you wanted, but hey, if it works....

The idea is that IIS could serve many sites geared to different regions, so what you have in your control panel regional settings will not pertain.

I am at a loss as to why doing this in the global.asa  does not do it--for whatever reason, it appears that the pages don't inherit that property setting.

FtB
0
 

Author Comment

by:macdpa
ID: 9716530
That makes two of us, as soon as this problem came to my attention I went through and did the alterations to the global.asa in all the websites on the server. If I can help it I wish to avoid having to edit all the inidividual pages of all the websites affected.

We never use to have this problem it just appeared one day.

Paul.
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 500 total points
ID: 9716579
>>If I can help it I wish to avoid having to edit all the inidividual pages of all the websites affected.<<

Boy, oh boy, do I hear you!

I generally have header and footer include files on my pages. That way, if I need a global change, I can just make one modification.

It is a strange thing, and I can't speak with authority here, but it seems that global.asa files can interfere with each other when you have a main site with a series of virtual directories under it.

By and large, this is why I rarely use the global.asa--the Session  On End has never worked well, and most of what I want to do with the Session On Start can be done with an include file.

FtB

0
 
LVL 7

Expert Comment

by:vnvk
ID: 12046225
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Accept: fritz_the_blank {http:#9716579}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

vnvk
EE Cleanup Volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Loops Section Overview

610 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