using System.Globalization;
using System.Collections.Generic;
static DateTime value = new DateTime(2012, 5, 28, 22, 35, 0);
public static void Main()
var cultures = (new List<string> { "en", "en-US", "en-GB", "de", "fr", "zh"});
var cultureResults = cultures
.Select(c => ShowCulture(c)).Prepend(Patterns())
.SelectMany(inner => inner.Select((item, index) => new { item, index }))
.GroupBy(i => i.index, i => i.item)
var table = new ConsoleTable(cultures.Prepend(" ").ToArray());
foreach(var c in cultureResults) table.AddRow(c.ToArray());
table.Write(Format.MarkDown);
private static List<string> ShowCulture(string cultureName) {
var culture = CultureInfo.GetCultureInfo(cultureName);
DateTimeFormatInfo dtfi = culture.DateTimeFormat;
Type typ = dtfi.GetType();
PropertyInfo[] props = typ.GetProperties();
return (new List<PropertyInfo>(props))
.Where(p => p.Name.Contains("Pattern"))
.Select(prop => value.ToString(prop.GetValue(dtfi, null).ToString()))
.Prepend(culture.DisplayName)
private static List<string> Patterns() {
DateTimeFormatInfo dtfi = CultureInfo.GetCultureInfo("en").DateTimeFormat;
Type typ = dtfi.GetType();
PropertyInfo[] props = typ.GetProperties();
return (new List<PropertyInfo>(props))
.Where(p => p.Name.Contains("Pattern")).Select(p => p.Name).Prepend("").ToList();