ASP.NET – Format string by CultureInfo

C#

var my_date = DateTime.Now;
var my_culture = System.Globalization.CultureInfo.CreateSpecificCulture("it-IT");
var my_string = my_date.ToString("d MMMM", my_culture);
		
Console.WriteLine(my_string);

VB.NET

Dim my_date = DateTime.Now
Dim my_culture = System.Globalization.CultureInfo.CreateSpecificCulture("it-IT")
Dim my_string = my_date.ToString("d MMMM", my_culture)

Console.WriteLine(my_string)

Leave a Comment

Your email address will not be published. Required fields are marked *