Dates in US format and EU-format

F

Fabian

I am making a winforms-program in Visual Studio, that connects to an
Access database. In the database all dates are presented in this
format : dd-mm-yyyy. In my application I have a DatetimePicker, that
is presented in Dutch, the monthnames etc. But when I write this date
(e.g. 08-10-2004, which is oktober the 8th) to the table, my
application writes and picks up the date in US-format (10-08-2004).

My language settings for the machine are in Dutch notations, in Acces
the dates appear as I want them : mm-dd-yyy.

I have tried 'System.Threading.Thread.CurrentThread.CurrentUICulture =
New System.Globalization.CultureInfo("nl-NL")' and I have set Office
to work with the US language as default. No succes.

Can anyone advise me, please?
 
C

Cor Ligthert

Fabian,

Until now I have not found a reason why you have to do it as you do it now,
the only problem can be when you use as sometimes in Holland is done a US OS
and the datetime setting in that is not changed in that.

Your program should take automaticly the culture from the settings, that is
one of the biggest benefits from dotnet.

(You can set the culture when you are using an offline document what has
dates in an other culture setting and set temporary the culture for the
thread that processes that to the culture of the document).

See, for that for us confusing internal Microsoft datetime format, the
thread from David Gacek some rows bellow your question, especially about
that USA and ISO that I wrote.

I hope this helps?

Cor
 
H

Herfried K. Wagner [MVP]

Fabian said:
I am making a winforms-program in Visual Studio, that connects to an
Access database. In the database all dates are presented in this
format : dd-mm-yyyy. In my application I have a DatetimePicker, that
is presented in Dutch, the monthnames etc. But when I write this date
(e.g. 08-10-2004, which is oktober the 8th) to the table, my
application writes and picks up the date in US-format (10-08-2004).

My language settings for the machine are in Dutch notations, in Acces
the dates appear as I want them : mm-dd-yyy.

Avoid dealing with string representations of dates:

<URL:http://groups.google.de/groups?selm=u4GnYacTCHA.2428@tkmsftngp11>
 
P

Paul Clement

On 22 Nov 2004 02:04:14 -0800, (e-mail address removed) (Fabian) wrote:

¤ I am making a winforms-program in Visual Studio, that connects to an
¤ Access database. In the database all dates are presented in this
¤ format : dd-mm-yyyy. In my application I have a DatetimePicker, that
¤ is presented in Dutch, the monthnames etc. But when I write this date
¤ (e.g. 08-10-2004, which is oktober the 8th) to the table, my
¤ application writes and picks up the date in US-format (10-08-2004).
¤
¤ My language settings for the machine are in Dutch notations, in Acces
¤ the dates appear as I want them : mm-dd-yyy.
¤
¤ I have tried 'System.Threading.Thread.CurrentThread.CurrentUICulture =
¤ New System.Globalization.CultureInfo("nl-NL")' and I have set Office
¤ to work with the US language as default. No succes.
¤
¤ Can anyone advise me, please?

Access expects dates to be in U.S. format when using SQL so you will need to format the date
accordingly before update.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
C

Cor Ligthert

¤
¤ I have tried 'System.Threading.Thread.CurrentThread.CurrentUICulture =
¤ New System.Globalization.CultureInfo("nl-NL")' and I have set Office
¤ to work with the US language as default. No succes.
¤
¤ Can anyone advise me, please?

Access expects dates to be in U.S. format when using SQL so you will need
to format the date
accordingly before update.
Paul I am from Holland (nl-NL), you make me curious why does it go well when
I use a datetime in access withouth formating it.

I know no culture which is original using arabian numbers for dates, which
uses the USA dateformat beside the USA.

There can be more cultures, however it would be a greath stupidity from
Microsoft as it was as you wrote.

But it is not, Microsoft uses as I showed in another thread internaly
everywhere the same datetime format.

A pity is that it is the USA format and not ISO, what leads easily to
misunderstanding for people beside those in the USA and cultures not based
on Arabian numbers which use in arabian numbers written dates in a kind of
CocaCola culture format.

Cor
 
D

Doug Bell

Cor,
I have to agree whole heartedly. The backward format used in the US causes
grief when it forced on to the rest of the World.

In Access you need to format dates in the backward format (sometimes) when
used as criteria in queries. (Even though dates are stored internally as a
number)

Also had an instance some years back with a Honeywell Building Automation
System. It would not display in any other format. We did not sell any more
in Australia but started using the products that were developed in Europe.

Doug
 

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

Top