US vs UK Date format 
Author Message
 US vs UK Date format

Hi there,
I'm writing from a database to an asp page and the date is returned in US
format (mm/dd/yy)  despite it being in UK format (dd/mm/yy) in the database.
I want it returned in UK format.
I've checked the regional settings on the server and looked at the msdn
site.  No joy.

Am I missing something?



Sat, 05 Apr 2003 03:00:00 GMT  
 US vs UK Date format

Try setting Session.LCID briefly to 2057 (UK Locale). When LCID has this
value, all the functions - Date, Currency, etc. will print in UK format.

E.g.
<%

liLCID = Session.LCID

Session.LCID = 2057
Response.Write (Date())

Session.LCID = liLCID
%>

--
Manohar Kamath
Microsoft MVP - ASP
www.dotnetwire.com - .NET News
www.dotnetbooks.com - .NET Books


Quote:
> Hi there,
> I'm writing from a database to an asp page and the date is returned in US
> format (mm/dd/yy)  despite it being in UK format (dd/mm/yy) in the
database.
> I want it returned in UK format.
> I've checked the regional settings on the server and looked at the msdn
> site.  No joy.

> Am I missing something?



Sat, 05 Apr 2003 03:00:00 GMT  
 US vs UK Date format

If you have VBScript 5.x you can also get the same effect with SetLocale()...

--
Michael Harris
Microsoft.MVP.Scripting
--


Quote:
> Try setting Session.LCID briefly to 2057 (UK Locale). When LCID has this
> value, all the functions - Date, Currency, etc. will print in UK format.

> E.g.
> <%

> liLCID = Session.LCID

> Session.LCID = 2057
> Response.Write (Date())

> Session.LCID = liLCID
> %>

> --
> Manohar Kamath
> Microsoft MVP - ASP
> www.dotnetwire.com - .NET News
> www.dotnetbooks.com - .NET Books



> > Hi there,
> > I'm writing from a database to an asp page and the date is returned in US
> > format (mm/dd/yy)  despite it being in UK format (dd/mm/yy) in the
> database.
> > I want it returned in UK format.
> > I've checked the regional settings on the server and looked at the msdn
> > site.  No joy.

> > Am I missing something?



Sat, 05 Apr 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. is date() accepts both UK and US date formats

2. Switching between US and Uk date formats

3. UK to US date converstation for SQL

4. Converting a US date string to UK

5. US/UK Date corruption: Jet 3.5 stored procs via Jet 4

6. Change Default Date Format, USA -> UK

7. UK Date Formatting

8. UK Date Format

9. SQL UK date format

10. UK date format with ASP

11. Date Validation for UK format (DD/MM/YY)

12. Date Confusion- SQL and UK format

 

 
Powered by phpBB® Forum Software