You can override the properties AMDesignatorand PMDesignator CultureInfo.DateTimeFormat, and then specify the culture as the format provider:
using System;
using System.Globalization;
class Program {
public static void Main() {
CultureInfo c = (CultureInfo)CultureInfo.CurrentCulture.Clone();
c.DateTimeFormat.AMDesignator = "A.M.";
c.DateTimeFormat.PMDesignator = "P.M.";
Console.WriteLine(DateTime.Now.ToString("tt",c));
}
}
source
share