How to print DateTime in Persian format in C#
问题 What is the simplest way to print c# DateTime in Persian? currently I'm using : static public string PersianDateString(DateTime d) { CultureInfo faIR = new CultureInfo("fa-IR"); faIR.DateTimeFormat.Calendar = new PersianCalendar(); return d.ToString("yyyy/MM/dd", faIR); } Which throws an exception Not a valid calendar for the given culture 回答1: First you must note that you cannot put a Jalali Date in a DateTime object, you will get an exception in dates like "1392/02/31". So you must handle