By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,187 Members | 1,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,187 IT Pros & Developers. It's quick & easy.

Custom format in DateTimePicker

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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
Nov 16 '05 #2

P: n/a
doh,

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

Cor
Nov 16 '05 #3

P: n/a
ok - so what does AM / PM mean in any language other than latin ?

"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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

Nov 16 '05 #4

P: n/a
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


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #5

P: n/a
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/whatso...i?MEDIUM=radio

I hope this helps

Cor
Nov 16 '05 #6

P: n/a
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #7

P: n/a
Guy,

Because you did hard coded your format, in my opinion something nobody
should ever do.

But you can use the short words as in this case probably the best is the
standard ()
string st = dt.ToString()

See here the posibilities on that
http://msdn.microsoft.com/library/de...ringtopic4.asp

I hope this helps?

Cor
Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.