C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-20-2007, 12:04 AM   #1
CSharpener
 
vart's Avatar
 
Join Date: Oct 2006
Posts: 5,323
How do I format date as 10-Jan-1971 when regional setting is not English

I have a Windows with Regional settings - Hebrew
I have a consol application

and I have
Code:
System.DateTime date = new System.DateTime(1971,1,10);
System.Consol.WriteLine (date.ToString("dd-MMM-yyyy"));
Which outputs some strange non-readable symbols instead of short month name.

I'd like to see a month name or in Hebrew - or (preffered) ignoring regional settings of the windows - in English

How do I do it?

PS. I DO know how to output month as a number. I need a name.
I have tried to change the CodePage of the Consol - no success.
__________________
If I have eight hours for cutting wood, I spend six sharpening my axe.
vart is offline   Reply With Quote
Old 11-20-2007, 12:51 AM   #2
CSharpener
 
vart's Avatar
 
Join Date: Oct 2006
Posts: 5,323
Found answer

Aded at the beginning of the Main

Code:
                System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-us",false);
__________________
If I have eight hours for cutting wood, I spend six sharpening my axe.
vart is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
100000 women Snafuist General Discussions 36 05-27-2009 07:41 AM
reading a file nhubred C++ Programming 3 05-21-2009 11:34 AM
A-Star Pathfinding mike_g General AI Programming 1 08-05-2007 04:18 PM
Segmentation Fault Lost__Soul C Programming 46 04-28-2003 04:24 AM
Scheduling Algo BigDaddyDrew C++ Programming 41 03-08-2003 11:00 AM


All times are GMT -6. The time now is 06:42 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22