How to

get abbreviated month names

Published: 12. October 2011 | Updated: 12. October 2011
License: Microsoft Public License (MS-PL)
Categories: Globalization » Calendar
Tags: C# Globalization
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.Globalization;

Code

var culture = CultureInfo.GetCultureInfo("en-US");
var dateTimeInfo = DateTimeFormatInfo.GetInstance(culture);

foreach (string name in dateTimeInfo.AbbreviatedMonthNames)
{
    Console.WriteLine(name);
}
Console Output:
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
Send us feedback about this snippet »



Related Snippets: