American vs. British date format

Results 1 to 5 of 5

Thread: American vs. British date format

  1. #1
    Join Date
    Dec 1969
    Posts
    500

    Default American vs. British date format

    Hi all,<BR><BR>On one of my servers when I run &#060;%=Date%&#062;, I get the american date format, e.g., mm/dd/yyyy. On another server I run the same code and get the british date format, e.g., dd/mm/yyyy. <BR><BR>here&#039;s an example:<BR>http://www.canasoft.net/date.asp<BR>http://spectrum.canasoft.net/date.asp<BR><BR>Both servers have the same regional settings (set to display date as mm/dd/yyyy). <BR><BR>I&#039;d like to get both servers to display the American date format by default. Can anyone give me a lead on how to do this, or at least what could be causing the two servers to behave differently?<BR><BR>Thanks.

  2. #2
    Join Date
    Dec 1969
    Posts
    95,951

    Default Session.LCID = &H0409

    Somebody has set up the default LCID as &H0809 (or maybe some other values, but not &H0409) on the one server. But if you just put in Session.LCID=&h0409 in your Session_onStart code, it won&#039;t matter what the server&#039;s default is.<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    500

    Default Thanks!

    It works perfectly. :)

  4. #4
    Join Date
    Dec 1969
    Posts
    304

    Default RE: American vs. British date format

    You can add the following at the top of your asp pages to set the locale<BR><BR>&#060;%Session.LCID = 1033%&#062; for United Kingdom<BR>&#060;%Session.LCID = 2048%&#062; for United States


  5. #5
    Join Date
    Dec 1969
    Posts
    95,951

    Default You have it all wrong...

    1033 *IS* for the USA. &h0409 (hex) is the same as 1033 (decimal).<BR><BR>2048 simply means "system default". So if you used <BR> Session.LCID = 2048<BR>on a system where the default was China...well, you&#039;d get China.<BR><BR>2048 decimal is &h0800, and no valid LCID ends in "00" in its hex form.<BR><BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


More ASP Resources

Resources:
-- ASP Articles
-- ASP.NET Information
-- 4Guys ASP F.A.Q.
-- ASPFAQs.com
-- ASP Coding Tips
-- Related Web Technologies
-- User Tips!!
-- JavaScripts


Development Centers
-- HTML5 Development Center
-- Windows Mobile Development Center
-- Android Development Center
-- Cloud Development Project Center


Development Technology
Check out these sites for more articles, tutorials, FAQs, discussions, and code!
-- CodeGuru.com
-- VBForums.com
-- DevX.com
-- Developer.com
-- HTMLGoodies