PersianCalendar persianCalendar = new PersianCalendar(); DateTime currentDate = DateTime.Now; int dayOfMonth = persianCalendar.GetDayOfMonth(currentDate); Console.WriteLine("Day of month: {0}", dayOfMonth);
PersianCalendar persianCalendar = new PersianCalendar(); DateTime date = new DateTime(1380, 5, 10, persianCalendar); int dayOfMonth = persianCalendar.GetDayOfMonth(date); Console.WriteLine("Day of month: {0}", dayOfMonth);Output: Day of month: 10 The PersianCalendar class is a part of the System.Globalization namespace in C#.