469,927 Members | 1,978 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Dates in US format and EU-format

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.CurrentUICu lture =
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?
Nov 21 '05 #1
5 1671
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

"Fabian" <ba***@chello.nl>
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.CurrentUICu lture =
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?

Nov 21 '05 #2
"Fabian" <ba***@chello.nl> schrieb:
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%40tkmsftngp11>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #3
On 22 Nov 2004 02:04:14 -0800, ba***@chello.nl (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.CurrentUICu lture =
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 ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 21 '05 #4
I have tried 'System.Threading.Thread.CurrentThread.CurrentUICu lture =
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
Nov 21 '05 #5
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

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I have tried 'System.Threading.Thread.CurrentThread.CurrentUICu lture =
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

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by David Lindsay | last post: by
8 posts views Thread by netsurfer | last post: by
2 posts views Thread by Rachel Suddeth | last post: by
1 post views Thread by pitfour.ferguson | last post: by
27 posts views Thread by rhaazy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.