Date problem

G

GriffithsJ

Hi

I have two Win2K machines. Both "appear" to have been set up identically.

They both reckon that they're using UK date format.

However, if I create the following ASP code:

<%
Response.Write Now
%>

One returns
16/01/2004 17:12:19

Which is what I want, whilst the other returns:

1/16/2004 5:15:21 PM

Here, the day and month have been transposed and the time appears in the 12
hour clock format.

Any suggestions as to how I can fix this?

Many thanks

Griff
 
S

sharad

Start->Control Panel->Regional & langauge settings.
Click on 'Customise'
Click on 'Date' tab and select the format you want for short as well as long
date. click on "Time" tab and select
the hours clock format you want.
 
A

Aaron Bertrand [MVP]

That only affects the current logged on user. When he/she logs off, it goes
back to the default, or get overridden by someone else logged on (even
through terminal services, I believe).

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
 
G

GriffithsJ

This reports that it's set up the way that I require it. However, that's
not the case...
 
S

sharad

well, SQL commands, by default use US date and time format. Even if the
machines are set as I said, Date() function in SQL will return the date and
time in US format. The solution I found from varous white pages is (examle
in VB) to use DateSerial function. [DateSearil(yyyy,mm,dd)].
Dunno about ASP code, may be it also has the same problem.

Sharad
 
G

GriffithsJ

Solved it!

As mentioned, everything on the machine pointed towards the fact that the
machine had been set up correctly - nothing in the registry pointed towards
there being a mm/dd date format anywhere.

We next attacked the IIS metabase, adding the key but to no affect.

We then tried adding
Session.LCID = 2057

and this solved everything...(certainly cures the symptons if not the
problem)

Griff
 
B

Balslev

Hi Griff,

Where in metabase.xml did you enter this setting, and wasn't it
SessionLCID="2057"
to be exact?

I think my decimalpoint-problem has the same solution.

Thanks,

/René
 
B

Balslev

Sorry - of course you didn't insert Session.LCID into the metabase. It was
obviously ASP.

CU

/René
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top