471,317 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

How to set culture in the application?

I would like to use the date format as dd/mm/yyyy, normaly i have to set the
Windox XP culture info. How to set the application culture to the format i
need winthout change the Windox XP setting ?

Thanks.
Jan 14 '06 #1
2 33416
Hi Tsair,

Use the CultureInfo class. Change the CultureInfo in the CurrentThread class

System.Threading.Thread.CurrentThread.CurrentCultu re =
CultureInfo.CreateSpecificCulture("en-US");
label1.Text = DateTime.Now.ToString();

Store the CultureInfo reference before changing it if you need to change it back to the original.
On Sat, 14 Jan 2006 06:14:28 +0100, Tsair <ls*****@yahoo.com> wrote:
I would like to use the date format as dd/mm/yyyy, normaly i have to set the
Windox XP culture info. How to set the application culture to the format i
need winthout change the Windox XP setting ?

Thanks.


--
Happy coding!
Morten Wennevik [C# MVP]
Jan 14 '06 #2

"Tsair" <ls*****@yahoo.com> wrote in message
news:O%***************@TK2MSFTNGP11.phx.gbl...
I would like to use the date format as dd/mm/yyyy, normaly i have to set
the Windox XP culture info. How to set the application culture to the
format i need winthout change the Windox XP setting ?

Thanks.


IMHO it is always wrong to mess with cultures.
If you really must have a specific format then format the dates explicitly.
You should then provide the user with the option to specify what format HE
wants...oh the culture already does that!
Jan 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Aliasgar Pocketwala | last post: by
3 posts views Thread by Ashish | last post: by
3 posts views Thread by Rachel | last post: by
2 posts views Thread by saravanan.arul | last post: by

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.