Using the Persian Calendar
using System;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Threading;
public class Example
{
public static void Main()
{
PersianCalendar persian = new PersianCalendar();
DateTime date1 = new DateTime(1998, 5, 27, 16, 32, 0, persian);
Console.WriteLine(date1.ToString());
Console.WriteLine("{0}/{1}/{2} {3}{6}{4:D2}{6}{5:D2}\n",
persian.GetMonth(date1),
persian.GetDayOfMonth(date1),
persian.GetYear(date1),
persian.GetHour(date1),
persian.GetMinute(date1),
persian.GetSecond(date1),
DateTimeFormatInfo.CurrentInfo.TimeSeparator);
}
}
Related examples in the same category
1. | Calendar ToDateTime is not culture aware | | |
2. | ToString(): make it culture aware | | |
3. | Two Digit Year Max | | |
4. | To Four Digit Year | | |
5. | Create date of 1/13/2009 using Hijri calendar and get Day property from DateTime | | |
6. | Calendar represents time in divisions, such as weeks, months, and years. | | |
7. | Add to year, month, week, day, hour, minute, second and millisecton | | |
8. | DateTime(Int32, Int32, Int32, Calendar): Create a DateTime structure to the specified year, month, and day for the specified calendar. | | |
9. | Using the Hijri Calendar | | |