Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


ASP/VBScript regional settings issue

Posted on 2003-03-06
Medium Priority
Last Modified: 2010-07-27
I know there is a problem with VBScript on in ASP/IIS that caused your script environment to inherit default regional settings from the last user that was logged on to the webserver etc.

Currently we bypassed this problem by making sure that all users and the default-rpofile on the system had the same regional settings.

Still when a new user is created it happens these settings are not properly set, which then starts causing problems in the application, which then requires manual intervention etc etc.

I'm wondering how other experts (you) are dealing with this particular problem when using VBScript (don't say use JScript :))
Did you write your own FormatDateTime routines, or do you use a fixed Locale by using the SetLocale() function, or did you find another way around ?

I would be glad to hear your solution(s).

Question by:newjack
  • 2

Expert Comment

ID: 8080707
We tried using SetLocale(), but found we still had problems.  Ended up having to write our own FormatDate functions.

And we also test for what the current locale is set to (it's only even UK or USA) by using:

if left(CDate("31/12/2002"), 2) = "31" then
  Session("LocaleDateFormat") = "DD/MM/YYYY"
  Session("LocaleDateFormat") = "MM/DD/YYYY"
end if

Author Comment

ID: 8086663
I suppose that session variable LocalDateFormat isn't something you can use with existing VBScript functions.
I can't think of any functions that can use a format like that, so I'm guessing you wrote your own functions to format and parse dates for input/output?


Accepted Solution

coreo earned 400 total points
ID: 8089310
Yes, we had to write functions that took either a date or string and formatted them the way we wanted them.  And to perform operations like DateAdd, etc.
LVL 58

Expert Comment

ID: 9352823
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by coreo

Please leave any comments here within the next seven days.
EE Cleanup Volunteer

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

564 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