Posts Tagged ‘format’

Setting a culture to an application

Wednesday, January 13th, 2010

To set a Culture (date format, decimal symbol, etc.) simply insert this code to the beginning of the application:

System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo(“en-GB”)

Remember, if you have a multi-threading application, you must insert this line at the beginning of every thread.

Get the name of the month in vb.net in any language

Friday, December 11th, 2009

If you want to get the name of a month in a specific language, you should try this code:

Dim myDTFI As Globalization.DateTimeFormatInfo = New Globalization.CultureInfo(“ro-RO”, True).DateTimeFormat
Console.Write(myDTFI.GetMonthName(2))

myDTFI.GetMonthName(2) will be “februarie”. Hope this helps you.