|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
Quote:
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!! |
|
#4
|
|||
|
|||
|
Quote:
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.. |
|
#5
|
|||
|
|||
|
Quote:
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > date keeps swapping around! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|