ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 22nd, 2004, 11:41 AM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 36 m 11 sec
Reputation Power: 6
date keeps swapping around!

Hi, i live in the UK and therfore our default date system is dd/mm/yyyy.

However im having real problems using dates in ASP using VBScript.

Ive set my Win XP system default to UK and forced settings in control panel to show SHORT DATE as dd/mm/yyyy.

However, if i make a really simply ASp page which outputs "date()", then i get the date in U.S format which is mm/dd/yyyy.

This is really messing up my ASP pages because if I try to save (in to MS access) the date of 2nd January 2004 (dd/mm/yyyy), then it gets saved as 1st February 2004 because the day and month values have been switched.

Ive cant see anywhere in access to change the date settings, but the underlying problem remains that when outputting the date froma simple ASP page, it prints out as international format when all my system settings are set to UK format.

Many thanks for any help you can offer.
__________________
-Seb

Reply With Quote
  #2  
Old February 22nd, 2004, 12:08 PM
mpearce's Avatar
mpearce mpearce is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: NewHampshire, USA
Posts: 416 mpearce User rank is Corporal (100 - 500 Reputation Level)mpearce User rank is Corporal (100 - 500 Reputation Level)mpearce User rank is Corporal (100 - 500 Reputation Level)mpearce User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 30 m 44 sec
Reputation Power: 9
Send a message via AIM to mpearce
I have read that you can do this: <%session.lcid=2057%> to set the location to UK.

I think this changes more than just the date though, so you might want to read up on it.

Here is more information on it.
http://www.w3schools.com/asp/prop_lcid.asp

http://www.devguru.com/Technologies...ssion_lcid.html

http://www.webwizguide.info/asp/faq...me_settings.asp
__________________
Mark Pearce

Last edited by mpearce : February 22nd, 2004 at 12:16 PM.

Reply With Quote
  #3  
Old February 22nd, 2004, 02:07 PM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 36 m 11 sec
Reputation Power: 6
Quote:
Originally Posted by mpearce
I have read that you can do this: <%session.lcid=2057%> to set the location to UK.

I think this changes more than just the date though, so you might want to read up on it.

Here is more information on it.
http://www.w3schools.com/asp/prop_lcid.asp

http://www.devguru.com/Technologies...ssion_lcid.html

http://www.webwizguide.info/asp/faq...me_settings.asp


Thanks for your help but ive already tried this. It literally has no effect on my system. If i change the ID code to 1003 the, yes, all the formates change to American. But when i change it back to the UK code, i still get the date showing up at 2/22/2004 (22nd Frebruary 2004)

This is REALLY gettting annoying now!!

Reply With Quote
  #4  
Old February 23rd, 2004, 10:43 AM
natty natty is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 natty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by seb835
Thanks for your help but ive already tried this. It literally has no effect on my system. If i change the ID code to 1003 the, yes, all the formates change to American. But when i change it back to the UK code, i still get the date showing up at 2/22/2004 (22nd Frebruary 2004)

This is REALLY gettting annoying now!!


i have had this problem too, and i gave up looking for an answer, youll just have to plan for it and write a function to convert the dates yourself..

Reply With Quote
  #5  
Old February 23rd, 2004, 01:10 PM
seb835 seb835 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: UK, London
Posts: 95 seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level)seb835 User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 36 m 11 sec
Reputation Power: 6
Quote:
Originally Posted by natty
i have had this problem too, and i gave up looking for an answer, youll just have to plan for it and write a function to convert the dates yourself..


Yeah its so wierd, it does the same in windows server 2003 as well as XP.

The only work-around that I can find is to set the local id to FRANCE which has the same date system as we do in the UK. If I have a darte value to display or save, then i set the locale id like this (just before when i need it):

<% Session.LCID=1036 %>

and then change it back immediately to UK:

<% Session.LCID=2057 %>

This works great, ok its a little bit of a crude-butchering-HACK, but who cares as long as it does the job!

Hope this helps someone.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > date keeps swapping around!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT