Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Locale Help
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Locale Help

 Post Reply Post Reply Page  12>
Author
tim_r View Drop Down
Newbie
Newbie


Joined: 05 January 2004
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote tim_r Quote  Post ReplyReply Direct Link To This Post Topic: Locale Help
    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

Back to Top
tim_r View Drop Down
Newbie
Newbie


Joined: 05 January 2004
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote tim_r Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
tim_r View Drop Down
Newbie
Newbie


Joined: 05 January 2004
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote tim_r Quote  Post ReplyReply Direct Link To This Post 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....

 

Back to Top
tim_r View Drop Down
Newbie
Newbie


Joined: 05 January 2004
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote tim_r Quote  Post ReplyReply Direct Link To This Post 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)

Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
tim_r View Drop Down
Newbie
Newbie


Joined: 05 January 2004
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote tim_r Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.