Print Page | Close Window

Access/ASP Date problem

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=21296
Printed Date: 29 March 2026 at 4:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Access/ASP Date problem
Posted By: ainsworth14
Subject: Access/ASP Date problem
Date Posted: 14 September 2006 at 7:45pm
Hi guys
 
I have a small problem with my ASP page that connects to an Access table.
 
I have a date field in my table that has a date field with a default value of NOW()
 
The date within Access shows 14/09/2006 17:00:02. This is fine.
 
although when i try to display that information in my ASP page it displays as 9/14/2006 5:00:02 PM
 
I'm in the UK so want to display the date as 14/09/2006. Why does my page change things around when Access displays correctly. How can I solve it without endless code to format it?
 
Thanks
Mark
 
 



Replies:
Posted By: michael
Date Posted: 14 September 2006 at 9:58pm
Access displays it locally on your computer based on your local date settings. ASP displays it on the Server based on the server date settings which is likely in the US. You have to override the date settings in the asp page;
Session.LCID = xxxx
where xxxx is your contries code. I think this only works if the locale is installed on that server though... Ought to look up what the UK's LCID is.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: MadDog
Date Posted: 14 September 2006 at 10:32pm
http://www.webwiz.net/asp/faq/date_time_settings.asp - http://www.webwiz.net/asp/faq/date_time_settings.asp


-------------
http://www.iportalx.net" rel="nofollow">


Posted By: ainsworth14
Date Posted: 15 September 2006 at 10:14am

thanks for the replys.

I found out the problem only affets my localhost server and not my live site because my hosting company is based in London. So i will use the LCID to change on my test site if i need to to.
 
thanks for your help!
Mark


Posted By: ainsworth14
Date Posted: 18 September 2006 at 4:03pm

i changed my LCID to the UK one, it works fine but now my prices i have on my site are being affected - £4.00 prices are being displayed as £4!

Can i change the date format but not affect the price? or will i just have to live with it?


Posted By: michael
Date Posted: 18 September 2006 at 4:38pm
use the Formatnumber() function to always display 2 decimals.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net