Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Dates in Local Format - doesn't seem to work 1

Status
Not open for further replies.

Boblevien

Technical User
Nov 3, 2000
38
GB
I'm trying to use FormatDateTime(Date,2)to control the display of dates on a site which is being accessed from all over the world. The documentation says that
1 = Long Date in local format (ie 20 Nov 2000 in UK) and
2 = Short Date in local format (ie 20/11/2000 in UK but 11/20/2000 in US, etc)

I find that I can switch between Long and Short dates OK, (so something's happening) but they always appear in US format (mmddyy)

Am I doing something wrong?

Bob.
 
No,
US dates are the default. The formating of dates on a web browser is governed by two things - the LOCALEID/CODEPAGE and the regional settings on the actual Web Browser. In this case I think it has to do with the LOCALEID and CODEPAGE. You need to set these correclty to show the dates correctly.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Hi James,

That's rather what I thought but since my regional settings (Win 2000) are to display the date as dd-mm-yy why do they show up in IE5 as mm-dd-yy?

You mention browser settings but I thought they inherited these from the Control Panel?

I'm stumped!

Bob Levien.
 
If the CODEPAGE on the server is set differently then it overrides it. Also you have to remeber that dayes are sent back from the web server as text not as a date. its only when typing into web page and then format using VBScript that this situation will happen. Otherwise your regional settings will have no effect whatsoever unless some VBScript is used to format in a onload event script.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Hi James,

Yes, that's slowly been dawning on me! Thanks anyway. I guess I'll have to settle on an internationally acceptable format - I suppose "Weds Nov 22 2000" is going to be clearest.

Cheers,

Bob Levien.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top