Custom format in DateTimePicker

G

Guy Corriveau

Got a dateTimePicker o

o.Format = DateTimePickerFormat.Custom;

o.CustomFormat = "MM/dd/yyyy hh:mm tt";

the previous code work well when the Regional option is set to english
Canadian but do not display the AM or PM when the Regional option is set to
french canadian
 
C

Cor Ligthert

Guy,

I am curious because in my opinion is the behaviour more than correct.

Is in French Canadian the PM and AM used and what does it than mean in the
French language?

You can use very terrible constructions by setting the culture of the UI in
the constructor. However, I find that terrible because that is not changeble
than in anyway and really is your application than fixed for one culture.
You have to do that for the base class as well when you inherit your forms.

Maybe this helps

Cor
 
C

Cor Ligthert

doh,

I think I make a mistake, because I thought that for the DateTimePicker even
that changing in the constructor does not work.

Cor
 
G

Guy Corriveau

In fact, the interface of the software in working on, can be display in
french or English on a Click, and I made custom setting on the
datePicker to be sure, if the software is use in french the datePicker
will be in french, if the software is use in english the datePicker will
display date in english format.

When i try the code,
I put the regional setting in english
Software in engish display
the date picker display in english 12/01/2005 10:00 PM
software in french display
the date picker display in french 01-12-2005 22:00

I put the regional setting in french
Software in engish display
the date picker display in english 12/01/2005 10:00
software in french display
the date picker display in french 01-12-2005 22:00
 
C

Cor Ligthert

Guy,

One word, it is not the English format.

That is the language, what you are using is the US or English Canada culture
for date and time and the standard French way for that.

In most English speaking countries is the English way of datetime used.

See this page from the BBC I think it cannot be more English than that.

http://www.bbc.co.uk/cgi-perl/whatson/search/grid.cgi?MEDIUM=radio

I hope this helps

Cor
 
G

Guy Corriveau

December the 31 2004 at 10:00 PM

Why in this case the display show
with string to custom format "MM/dd/yyyy hh:mm tt"
12/31/2004 10:00 PM regional setting in english
12/31/2004 10:00 regional setting in french

and "dd-MM-yyyy HH:mm"
31-12-2004 22:00 regional setting in english
31-12-2004 22:00 regional setting in french
 

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