Regional Date Format

Results 1 to 2 of 2

Thread: Regional Date Format

  1. #1
    Join Date
    Dec 1969

    Default Regional Date Format

    My ASP/Jscript intranet form refuses to accept the date in Non-US format. My regional settings on the the SQL Server are in the correct format and the SQL backend accepts the date in the correct Australian format. When trying to enter the date I get a datetime out of range ODBC error. How can I make my ASP page accept the correct format or is this a ODBC problem ??<BR><BR>Thanks<BR>Craig

  2. #2
    Join Date
    Dec 1969

    Default RE: Regional Date Format

    It depends on *where* you are trying to get ASP to accept/display the format.<BR><BR>If you mean: How do I get it to do CDate("4/7/2001") and have it recognize that as "4 July 2001"? Then the answer lies in Session.LCID.<BR><BR>Now, if you&#039;re running on a server in Australia, I&#039;m more than a little surprised IIS isn&#039;t configured right, already, but it can&#039;t hurt to try:<BR><BR>&#060;%<BR>Session.LCID = &H0c09 &#039; I *believe* that &H0c09 is Australia Locale ID<BR>...<BR>%&#062;<BR><BR>You can test if that&#039;s the right LCID by doing:<BR><BR>Response.Write FormatDateTime( DateSerial(2001,7,4), vbLongDate )<BR>and<BR>Response.Write FormatCurrency( 1234567.6543 )<BR><BR>And you should get 4 July 2001 in standard Australian format and a currency output that also looks like standard Australian.<BR><BR>Ummm...but if you get good output *without* setting the LCID, then I&#039;m not sure where the problem is. So maybe you want to try that, first.<BR><BR>OOPS! I just saw something: You said it was ASP with JScript! Not with VBScript, right??? Ugh. JScript is a lot dumber about date formats than VBS. *MAYBE* Session.LCID will work with JS, but truth to tell, I&#039;ve never tried it.<BR><BR>Experiment some with Session.LCID. If I get a chance I&#039;ll play with some JScript and LCID, too. But I&#039;m not holding my breath.<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