Print Page | Close Window

Locale Help

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=9602
Printed Date: 31 March 2026 at 6:23pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Locale Help
Posted By: tim_r
Subject: Locale Help
Date Posted: 07 February 2004 at 7:09am

I'm having trouble getting dates in the UK format DD/MM/YYYY running IIS locally.

I have a global.asa file in the root directory of the default web app as:

Sub Session_OnStart

     'Set the server locale
     Session.LCID = 2057

End Sub

But I still get MM/DD/YYYY. 

My date time settings are GMT (UK).

I am retrieving dates from the access database and formatting them using:

FormatDateTime(rsLatestNewsPosts("Date_stamp"),2)

Please please someone tell me what I'm missing as it's really doing my head in now!!!!

Do I need to do anything to run the global.asa in IIS settings?

Thanks

Tim




Replies:
Posted By: tim_r
Date Posted: 07 February 2004 at 7:38am

Can someone please try running this:

<%
Response.Codepage = 65001
Response.Charset = "utf-8"

ShowDateTime 1033, "North America"
ShowDateTime 2057, "UK"

Sub ShowDateTime(iLCID, sLocale)
  Response.LCID = iLCID
  Response.Write "<B>" & sLocale & "</B><BR>"
  Response.Write FormatDateTime(Date, 1) & "<BR>"
  Response.Write FormatDateTime(Date, 2) & "<BR>"
End Sub
%>

I get:

North America
Saturday, February 07, 2004
2/7/2004
UK
07 February 2004
2/7/2004

It is changing the format but not correctly - is this a bug in my IIS then?



Posted By: WebWiz-Bruce
Date Posted: 07 February 2004 at 7:49am
With US dates the server shows the day, but with UK dates it doesn't in long format.

I guess the reason for this is that MS are American and only bothered making the long date format show the day (eg. Saturday) in the US locale.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: tim_r
Date Posted: 07 February 2004 at 8:01am

I'm actually only interested in getting DD/MM/YYYY

in the uk locale it still gives MM/DD/YYYY....

 



Posted By: tim_r
Date Posted: 08 February 2004 at 5:24am

can someone tell me how to use setLocaleInfo please

I think i should be able to use that to get the uk locale date into dd/MM/yyyy

I still can't get FormatDateTime to return UK dates it to work - any help greatly appreciated.

(Unfortunately I can't just write a routine to change them over because I do dev locally and deploy to a server which does give dd/MM/yyyy)



Posted By: WebWiz-Bruce
Date Posted: 08 February 2004 at 6:12am
Have you followed the page in the ASP section of this site on changing the web servers locale?

http://www.webwiz.net/asp/faq/date_time_settings.asp - http://www.webwiz.net/asp/faq/date_time_settings.asp


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: tim_r
Date Posted: 08 February 2004 at 10:48am
Yeah.  The code I posted before proved that the locale is changing - but the date format returned is still wrong for short fate format.  I think this is a bug in IIS.


Posted By: pmormr
Date Posted: 09 February 2004 at 7:33pm
it isn't a bug in IIS... the dates and times are default returned in the server format...

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: pmormr
Date Posted: 09 February 2004 at 7:34pm
make sure that the local settings are set correctly on the server...

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: tim_r
Date Posted: 13 February 2004 at 3:46pm

Cheers pmormr

How do I set the server date time format please (Sorry I'm thick at ASP - java guy....).  The regional settings on my machine are correct with dd/MM/yyyy and I am running IIS on my local machine - is that not enough for it?

Ta

 

 



Posted By: pmormr
Date Posted: 13 February 2004 at 7:11pm
take a look at this article... http://www.4guysfromrolla.com/webtech/031401-1.2.shtml - http://www.4guysfromrolla.com/webtech/031401-1.2.shtml

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: tim_r
Date Posted: 15 February 2004 at 2:19pm

I'm giving up on this now... there is definitely a bug in the IIS I'm running

I can correctly set the locale - as I showed in a previous thread in this topic - but the server does not bring back dd/MM/yyyy.  It does however show that the locale is 2057 and the server date time settings on the machine are correct.

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net