473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP date problems.

TC
Hi.

I have some ASP written in VB.net which is currently installed on a
customers server. The asp connects to a local MySql database and retrieves
data for the customers customers. If you see what I mean.

The problem is their server insists on showing dates in the US format. The
server has no other language installed than UK and all settings I can find
are UK.

My test server here, which as far as I can see is setup the same, shows
dates in the correct UK format.

Has anyone come accross this, or have any ideas?

Cheers.
Apr 8 '08 #1
9 1666
Could be a number of reasons for this, the first that comes to mind is that
the web server account has the wrong regional info.

I few questions:

What code are you using to format the dates?
Are you using the <globalizationelement in your web.config (and if so, how
is it set)?
Is the US format consistant across different browsers/machines?

/claes
"TC" <tu**@idcodeware.co.ukwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
Hi.

I have some ASP written in VB.net which is currently installed on a
customers server. The asp connects to a local MySql database and
retrieves data for the customers customers. If you see what I mean.

The problem is their server insists on showing dates in the US format.
The server has no other language installed than UK and all settings I can
find are UK.

My test server here, which as far as I can see is setup the same, shows
dates in the correct UK format.

Has anyone come accross this, or have any ideas?

Cheers.

Apr 8 '08 #2
TC
I'm not really using anything to format the dates, the return from MySql is,
as far as I know, the international format, so it's hh:mm:ss yyyy/mm/dd.
For putting data in the grid I'm simply looking for the " " (Space char) and
returning the right of the string.

Yes, it is repeated over any browser or client connection so the issue has
to be server side.

The Web Server account? The user account that controls access to the web
site?

I'm a little new to this technology so any help would be very much
appreciated.

Cheers.

"Claes Bergefall" <cl*************@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Could be a number of reasons for this, the first that comes to mind is
that the web server account has the wrong regional info.

I few questions:

What code are you using to format the dates?
Are you using the <globalizationelement in your web.config (and if so,
how is it set)?
Is the US format consistant across different browsers/machines?

/claes
"TC" <tu**@idcodeware.co.ukwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
>Hi.

I have some ASP written in VB.net which is currently installed on a
customers server. The asp connects to a local MySql database and
retrieves data for the customers customers. If you see what I mean.

The problem is their server insists on showing dates in the US format.
The server has no other language installed than UK and all settings I can
find are UK.

My test server here, which as far as I can see is setup the same, shows
dates in the correct UK format.

Has anyone come accross this, or have any ideas?

Cheers.


Apr 8 '08 #3
Usually the date format is controlled throught the globalization tag in the
web.config file.

Not sure about MySql but generally a DB system returns a date value not
text. So this is still a date value client side. This is only when the text
is written to text that this is converted to the text representation for the
current country whatever it is...

So try :
http://msdn2.microsoft.com/en-us/lib...e0(VS.80).aspx (culture,
uiCulture)
"TC" <tu**@idcodeware.co.uka écrit dans le message de news:
%2****************@TK2MSFTNGP05.phx.gbl...
I'm not really using anything to format the dates, the return from MySql
is, as far as I know, the international format, so it's hh:mm:ss
yyyy/mm/dd. For putting data in the grid I'm simply looking for the " "
(Space char) and returning the right of the string.

Yes, it is repeated over any browser or client connection so the issue has
to be server side.

The Web Server account? The user account that controls access to the web
site?

I'm a little new to this technology so any help would be very much
appreciated.

Cheers.

"Claes Bergefall" <cl*************@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Could be a number of reasons for this, the first that comes to mind is
that the web server account has the wrong regional info.

I few questions:

What code are you using to format the dates?
Are you using the <globalizationelement in your web.config (and if so,
how is it set)?
Is the US format consistant across different browsers/machines?

/claes
"TC" <tu**@idcodeware.co.ukwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
>>Hi.

I have some ASP written in VB.net which is currently installed on a
customers server. The asp connects to a local MySql database and
retrieves data for the customers customers. If you see what I mean.

The problem is their server insists on showing dates in the US format.
The server has no other language installed than UK and all settings I
can find are UK.

My test server here, which as far as I can see is setup the same, shows
dates in the correct UK format.

Has anyone come accross this, or have any ideas?

Cheers.



Apr 8 '08 #4
TC
I've had a look at the Web.Config file, but can't see anything in there for
date formats or globalization, maybe this is the problem. What should I be
looking for?

Cheers.

"Patrice" <http://www.chez.com/scribe/wrote in message
news:uW**************@TK2MSFTNGP05.phx.gbl...
Usually the date format is controlled throught the globalization tag in
the web.config file.

Not sure about MySql but generally a DB system returns a date value not
text. So this is still a date value client side. This is only when the
text is written to text that this is converted to the text representation
for the current country whatever it is...

So try :
http://msdn2.microsoft.com/en-us/lib...e0(VS.80).aspx (culture,
uiCulture)
"TC" <tu**@idcodeware.co.uka écrit dans le message de news:
%2****************@TK2MSFTNGP05.phx.gbl...
>I'm not really using anything to format the dates, the return from MySql
is, as far as I know, the international format, so it's hh:mm:ss
yyyy/mm/dd. For putting data in the grid I'm simply looking for the " "
(Space char) and returning the right of the string.

Yes, it is repeated over any browser or client connection so the issue
has to be server side.

The Web Server account? The user account that controls access to the web
site?

I'm a little new to this technology so any help would be very much
appreciated.

Cheers.

"Claes Bergefall" <cl*************@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>Could be a number of reasons for this, the first that comes to mind is
that the web server account has the wrong regional info.

I few questions:

What code are you using to format the dates?
Are you using the <globalizationelement in your web.config (and if so,
how is it set)?
Is the US format consistant across different browsers/machines?

/claes
"TC" <tu**@idcodeware.co.ukwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
Hi.

I have some ASP written in VB.net which is currently installed on a
customers server. The asp connects to a local MySql database and
retrieves data for the customers customers. If you see what I mean.

The problem is their server insists on showing dates in the US format.
The server has no other language installed than UK and all settings I
can find are UK.

My test server here, which as far as I can see is setup the same, shows
dates in the correct UK format.

Has anyone come accross this, or have any ideas?

Cheers.



Apr 8 '08 #5
TC
I've just changed the code so I'm forcing the culture to en-NZ, there
doesn't appear to be an en-UK setting. However NZ gives the same date
format required. However, again it works on my server, not on the
customers. I'm confused!

"TC" <tu**@idcodeware.co.ukwrote in message
news:uB*************@TK2MSFTNGP04.phx.gbl...
I've had a look at the Web.Config file, but can't see anything in there
for date formats or globalization, maybe this is the problem. What should
I be looking for?

Cheers.

"Patrice" <http://www.chez.com/scribe/wrote in message
news:uW**************@TK2MSFTNGP05.phx.gbl...
>Usually the date format is controlled throught the globalization tag in
the web.config file.

Not sure about MySql but generally a DB system returns a date value not
text. So this is still a date value client side. This is only when the
text is written to text that this is converted to the text representation
for the current country whatever it is...

So try :
http://msdn2.microsoft.com/en-us/lib...e0(VS.80).aspx (culture,
uiCulture)
"TC" <tu**@idcodeware.co.uka écrit dans le message de news:
%2****************@TK2MSFTNGP05.phx.gbl...
>>I'm not really using anything to format the dates, the return from MySql
is, as far as I know, the international format, so it's hh:mm:ss
yyyy/mm/dd. For putting data in the grid I'm simply looking for the " "
(Space char) and returning the right of the string.

Yes, it is repeated over any browser or client connection so the issue
has to be server side.

The Web Server account? The user account that controls access to the
web site?

I'm a little new to this technology so any help would be very much
appreciated.

Cheers.

"Claes Bergefall" <cl*************@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl.. .
Could be a number of reasons for this, the first that comes to mind is
that the web server account has the wrong regional info.

I few questions:

What code are you using to format the dates?
Are you using the <globalizationelement in your web.config (and if
so, how is it set)?
Is the US format consistant across different browsers/machines?

/claes
"TC" <tu**@idcodeware.co.ukwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
Hi.
>
I have some ASP written in VB.net which is currently installed on a
customers server. The asp connects to a local MySql database and
retrieves data for the customers customers. If you see what I mean.
>
The problem is their server insists on showing dates in the US format.
The server has no other language installed than UK and all settings I
can find are UK.
>
My test server here, which as far as I can see is setup the same,
shows dates in the correct UK format.
>
Has anyone come accross this, or have any ideas?
>
Cheers.
>




Apr 8 '08 #6
I'm not familiar with MySQL but I would expect the data to be stored using
some kind of datetime data type and not as text. In SQL Server you would use
smalldatetime or datetime to store a date and then work with the .NET
DateTime datatype in your ASP.NET pages. Once you have a DateTime object you
would use it's ToString method to format it in whatever way you want (see
DateTime.ToString)

If it's really stored as text and you simply extract the right part of the
string then I don't see any way for it to change format to US. If that is
the case the problem is in the MySQL server. You need to verify what
datatype is used and what it looks like. It would help if you could show the
code you're using to get the date from the database.

The <globalizationtag in web.config allows the web server to provide
formating according to the user's preferences. It gets this information from
the client browser (e.g. in IE you can specify what language you prefer in
the options). However, this only works if you're using real date types, so
figure out the things above first and you can deal with this step later
(it's entirely optional anyway)

As for the account thing; the process that hosts your ASP.NET application on
the web server (I'm guessing IIS?) runs under it's own account called ASPNET
(or something like that). That account has it's own settings regarding
security, culture info etc. If the machine was installed using a UK version
on Windows it most likely has the correct settings already.

/claes

"TC" <tu**@idcodeware.co.ukwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
I'm not really using anything to format the dates, the return from MySql
is, as far as I know, the international format, so it's hh:mm:ss
yyyy/mm/dd. For putting data in the grid I'm simply looking for the " "
(Space char) and returning the right of the string.

Yes, it is repeated over any browser or client connection so the issue has
to be server side.

The Web Server account? The user account that controls access to the web
site?

I'm a little new to this technology so any help would be very much
appreciated.

Cheers.

"Claes Bergefall" <cl*************@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Could be a number of reasons for this, the first that comes to mind is
that the web server account has the wrong regional info.

I few questions:

What code are you using to format the dates?
Are you using the <globalizationelement in your web.config (and if so,
how is it set)?
Is the US format consistant across different browsers/machines?

/claes
"TC" <tu**@idcodeware.co.ukwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
>>Hi.

I have some ASP written in VB.net which is currently installed on a
customers server. The asp connects to a local MySql database and
retrieves data for the customers customers. If you see what I mean.

The problem is their server insists on showing dates in the US format.
The server has no other language installed than UK and all settings I
can find are UK.

My test server here, which as far as I can see is setup the same, shows
dates in the correct UK format.

Has anyone come accross this, or have any ideas?

Cheers.



Apr 9 '08 #7
TC
No, the date is stored as a date, MySql basically uses 00:00:00 yyyy/MM/dd
as standard. So I've been pulling the date time from the database and
formatting text simply to remove anything left of the space char. So the
date format is already wrong before I do any formating.

I have tried forcing the culture, forcing a Format("dd/MM/yyyy", dte) but it
still shows US format of M/d/yyyy.

I'm beggining to think there is a problem with this server!

"Claes Bergefall" <cl*************@nospam.nospamwrote in message
news:u1**************@TK2MSFTNGP05.phx.gbl...
I'm not familiar with MySQL but I would expect the data to be stored using
some kind of datetime data type and not as text. In SQL Server you would
use smalldatetime or datetime to store a date and then work with the .NET
DateTime datatype in your ASP.NET pages. Once you have a DateTime object
you would use it's ToString method to format it in whatever way you want
(see DateTime.ToString)

If it's really stored as text and you simply extract the right part of the
string then I don't see any way for it to change format to US. If that is
the case the problem is in the MySQL server. You need to verify what
datatype is used and what it looks like. It would help if you could show
the code you're using to get the date from the database.

The <globalizationtag in web.config allows the web server to provide
formating according to the user's preferences. It gets this information
from the client browser (e.g. in IE you can specify what language you
prefer in the options). However, this only works if you're using real date
types, so figure out the things above first and you can deal with this
step later (it's entirely optional anyway)

As for the account thing; the process that hosts your ASP.NET application
on the web server (I'm guessing IIS?) runs under it's own account called
ASPNET (or something like that). That account has it's own settings
regarding security, culture info etc. If the machine was installed using a
UK version on Windows it most likely has the correct settings already.

/claes

"TC" <tu**@idcodeware.co.ukwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>I'm not really using anything to format the dates, the return from MySql
is, as far as I know, the international format, so it's hh:mm:ss
yyyy/mm/dd. For putting data in the grid I'm simply looking for the " "
(Space char) and returning the right of the string.

Yes, it is repeated over any browser or client connection so the issue
has to be server side.

The Web Server account? The user account that controls access to the web
site?

I'm a little new to this technology so any help would be very much
appreciated.

Cheers.

"Claes Bergefall" <cl*************@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>Could be a number of reasons for this, the first that comes to mind is
that the web server account has the wrong regional info.

I few questions:

What code are you using to format the dates?
Are you using the <globalizationelement in your web.config (and if so,
how is it set)?
Is the US format consistant across different browsers/machines?

/claes
"TC" <tu**@idcodeware.co.ukwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
Hi.

I have some ASP written in VB.net which is currently installed on a
customers server. The asp connects to a local MySql database and
retrieves data for the customers customers. If you see what I mean.

The problem is their server insists on showing dates in the US format.
The server has no other language installed than UK and all settings I
can find are UK.

My test server here, which as far as I can see is setup the same, shows
dates in the correct UK format.

Has anyone come accross this, or have any ideas?

Cheers.



Apr 9 '08 #8
TC wrote:
I've just changed the code so I'm forcing the culture to en-NZ, there
doesn't appear to be an en-UK setting.
It would be en-gb, not en-uk.

For an Access db, you can specify the locale in the connection string, e.g.:

"Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Locale
Identifier=2057;Uid=Admin;Pwd=;"

....maybe you can find similar for mySql.

Andrew
Apr 9 '08 #9

"TC" <tu**@idcodeware.co.ukwrote in message
news:OP**************@TK2MSFTNGP03.phx.gbl...
No, the date is stored as a date, MySql basically uses 00:00:00 yyyy/MM/dd
as standard. So I've been pulling the date time from the database and
formatting text simply to remove anything left of the space char. So the
date format is already wrong before I do any formating.
This doesn't make sense. If the date is stored in the database using a real
date type then where are you getting the string 00:00:00 yyyy/MM/dd from?
Who created that string? What kind of data type do you have on the .NET side
of things?

I looked into MySQL a bit more and I noticed they have an ADO.NET library
with a MySqlDateTime type. Is this what you're using? If so you should be
able to get a real .NET DateTime object using the MySqlDateTime.GetDateTime
method. Once you have that it's a simple thing to format it the way you
want.

It would help if you could show us the code you're using to get the dates
from the database and also how you're formatting the output.

>I have tried forcing the culture, forcing a Format("dd/MM/yyyy", dte) but
it still shows US format of M/d/yyyy.
Is this .NET code? What's the datatype of the dte parameter?

>I'm beggining to think there is a problem with this server!
Well, it looks like the server is not setup exactly the same way as your
test server. On the other hand I also think there is a problem with your
code in the way it handles dates.
/claes
Apr 10 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: carverk | last post by:
Hello All I'm in the middle of moving a MS Access DB to a MySql backend. I have figured out about 90% of the problems I have faced, execpt for this one. I have 3 Queries, which pull records...
5
by: Corky | last post by:
This works: db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID = PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -...
13
by: Deano | last post by:
Hi, I generate a report using two dates (From and To). I notice if I enter 01/10/2003 that it is interpreted by Access as 10/01/2003 i.e 10th January rather than 1st October as I intended. ...
2
by: Riegn Man | last post by:
I have a problem with access and our time clocks. We have time clocks that put out a .log file with the badge swipes for everybody. There is one .log file for each day. I am pulling that data...
2
by: hardik | last post by:
hi friends, i am really surprized the way access behaves in date fields i mean it's all ok when you have us time zone or us servers but if you have diffrent timezone like uk then access creates...
3
by: rn5a | last post by:
In my local computer, date has been set in this format - dd/MM/yyyy. When I insert records in a MS-Access DB table using ASP.NET, then the records get inserted in the Access DB table exactly in the...
2
by: thewilldog | last post by:
Hello, I've reviewed the archives here to address the issue, but I'm still running into problems. I've got a table field populated with the record date in text "YYYYMMDD" To convert it into a...
3
by: JJ | last post by:
Here's the code. $link="http://xbox360cheat.org"; $close_date=$_POST; #last content change check if ($close_date == 0) $close_date = date("Y-m-d H:m:s", mktime(12, 0, 0, date("m"), date...
16
by: W. eWatson | last post by:
Are there some date and time comparison functions that would compare, say, Is 10/05/05 later than 09/22/02? (or 02/09/22 format, yy/mm/dd) Is 02/11/07 the same as 02/11/07? Is 14:05:18 after...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.