Click here to Skip to main content
15,902,276 members
Please Sign up or sign in to vote.
2.71/5 (7 votes)
See more:
How do I change the system date format, like if i need my system date format should appear Mon/March/11.
Posted
Updated 13-Mar-11 23:47pm
v2
Comments
Toli Cuturicu 14-Mar-11 18:31pm    
Never ever attempt to do such a monstruousity!
I would qualify your software as malware.
Toli Cuturicu 15-Mar-11 8:20am    
I deleted your answer. Don't try it again.
Bhavna v 16-Mar-11 5:48am    
cheap work... nothing else
Gonzoox 15-Mar-11 8:53am    
Guys, guys, he wants the solution, not advice,so Bhavna, having the solution will cost you 350 USD, having it integrated to your class/application will cost you the same but per hour, you can wire transfer the money to my account, when I get the confirmation from the bank I'll send you an email, if you send me the class/application I can give you an estimate of how long is going to take me.
I'm a professional (not like you) and I'll deliver what I promise
Bhavna v 16-Mar-11 5:49am    
ofcourse you are not like me.

Hey try this..

RegistryKey rkey = Registry.CurrentUser.OpenSubKey(@"Control Panel\International", true);
rkey.SetValue("sShortDate", "d/M/yy");
rkey.SetValue("sLongDate","dd/MM/yy");
 
Share this answer
 
v2
Comments
Sona s 25-Mar-11 9:16am    
Already asked by some1, now it's solved
Thiri Aung 16-Mar-12 0:35am    
thanx .. this is helpful to me ^^
Member 11512227 10-Mar-15 4:27am    
it works perfectly.
thank you so much.
A very dirty hack could be to change the registry settings.

However, as mentioned by OriginalGriff, this is not a recommended practice as your users are going to be thrown into a tizzy (unless this is their requirement).
 
Share this answer
 
v4
Comments
Manfred Rudolf Bihy 14-Mar-11 5:40am    
Sorry I voted too quickly before I taking a serious look.
OP asked about changing the date format. Your link goes on about setting the local time and date or did I miss anything essential?
sandeepbongale19@gmail.com 2-Sep-13 8:33am    
Thanks, It's Really Good
Abhinav S 14-Mar-11 5:43am    
Thank you Manfred. :)
Manfred Rudolf Bihy 14-Mar-11 5:46am    
Look again Abhinav as I changed my vote. Can you clear up my confusion?
Manfred Rudolf Bihy 14-Mar-11 8:45am    
Re-re-adjusted my vote! 5+
I think the best advice for OP is not to change that setting!
Don't. If you change the system date format you will:
1) Annoy the heck out of your users - if an app did that to me, I would be extrememly annoyed.
2) Probably break a lot of other apps, which rely on teh user knowing what date format to enter.

Instead, use the format strings available with the DateTime.ToString[^] and DateTime.ParseExact[^] methods.
You will find a complete list here: Formatting a DateTime for display - format string description[^]
 
Share this answer
 
Comments
Olivier Levrey 14-Mar-11 5:34am    
Voted 5 and proposed as answer. It is not a good idea at all to change user settings.
Manfred Rudolf Bihy 14-Mar-11 5:39am    
Very good argument! 5+
Bhavna v 14-Mar-11 5:44am    
I only need solution not advice...
well Thank
Richard MacCutchan 14-Mar-11 8:29am    
No, I think you need advice.
Manfred Rudolf Bihy 14-Mar-11 8:44am    
You tell him!
When I saw OP's response I wanted to add a snide remark, but your comment is way better than what I had in mind :).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900