コード例 #1
0
        public static DateTime ToMiladiDateTime(this EasyDate s)
        {
            PersianCalendar pc  = new PersianCalendar();
            var             ret = pc.ToDateTime(s.Year, s.Month, s.Day, s.Hour ?? 0, s.Minute ?? 0, 0, 0);

            return(ret);
        }
コード例 #2
0
        public static EasyDate ToPersianDateInfo(this DateTime dateTime)
        {
            PersianCalendar pc = new PersianCalendar();
            var             r  = new EasyDate()
            {
                Year   = pc.GetYear(dateTime),
                Month  = pc.GetMonth(dateTime),
                Day    = pc.GetDayOfMonth(dateTime),
                Hour   = pc.GetHour(dateTime),
                Minute = pc.GetMinute(dateTime)
            };

            return(r);
        }
コード例 #3
0
 public static string ToShamsiDateTimeString(this EasyDate s)
 {
     return(s.ToShamsiDateString() + " - " + s.Hour + ":" + s.Minute);
 }
コード例 #4
0
 public static string ToShamsiDateString(this EasyDate s)
 {
     return(new DateTime(s.Year, s.Month, s.Day).ToPersianDate());
 }
コード例 #5
0
 public static EasyDate ToMiladiInfo(this EasyDate s)
 {
     return(ToMiladiDateTime(s).ToDateiInfo());
 }