Created
October 20, 2016 15:36
-
-
Save portal7/b34342390ba3e1a95f1415685dfafe9f to your computer and use it in GitHub Desktop.
Month to String with Culture Spanish / Mes a partir de una Fecha en C# con cultura Español
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string MonthName(int month) | |
{ | |
DateTimeFormatInfo dtinfo = new CultureInfo("es-ES", false).DateTimeFormat; | |
return dtinfo.GetMonthName(month); | |
} | |
// Use | |
DataTime fecha = Convert.ToDateTime("16/04/2010"); | |
Console.WriteLine( MonthName(fecha.Month)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment