Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Access/ASP Date problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Access/ASP Date problem

 Post Reply Post Reply
Author
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post Topic: Access/ASP Date problem
    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
 
 
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2006 at 10:32pm
Back to Top
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2006 at 4:38pm
use the Formatnumber() function to always display 2 decimals.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.