コード例 #1
0
        public void MyTestMethod()
        {
            var x3  = PersianDateTime.GetDiffrenceToNow(DateTime.UtcNow.AddDays(-1365));
            var d1  = new PersianDateTime(1397, 5, 31);
            var d2  = new PersianDateTime(1397, 6, 8);
            var d3  = new PersianDateTime(1399, 6, 7);
            var d4  = new PersianDateTime(1410, 10, 24);
            var str = d1.ToString("YYYY/mm/dd");

            d1  = new PersianDateTime(1397, 6, 31);
            str = d1.ToString("yyyy/MM/dd h:mm tt");
            str = d1.ToString("dddd, dd MMMM yyyy");
            str = d1.ToString("dddd, dd MMMM yyyy HH:mm");
            str = d1.ToString("yyyy/MM/dd HH:mm");
            str = d1.ToString("yyyy/MM/dd HH:mm:ss");

            var      dn   = PersianDateTime.GenerateYearlyCalender(1375);
            var      item = d1.DateMetaDatas;
            DateTime date = DateTime.Now;
            var      dt2  = new PersianDateTime("1399/11/29");
            var      y1   = PersianDateTime.GetHijriDate(dt2);
            var      y    = PersianDateTime.GetHijriDate(DateTime.UtcNow);
            var      x    = PersianDateTime.GetDiffrenceToNow(DateTime.UtcNow);
            var      x1   = PersianDateTime.GetDiffrenceToNow(DateTime.UtcNow.AddDays(-10));
            var      x2   = PersianDateTime.GetDiffrenceToNow(DateTime.UtcNow.AddDays(-100));
            //var x3 = PersianDateTime.GetDiffrenceToNow(DateTime.UtcNow.AddDays(-1365));
            var x4 = PersianDateTime.GetDiffrenceToNow(DateTime.UtcNow.AddDays(365));
            var x5 = PersianDateTime.GetDiffrenceToNow(DateTime.UtcNow.AddDays(10));
            var x6 = PersianDateTime.GetDiffrenceToNow(DateTime.UtcNow.AddDays(100));
            var x7 = PersianDateTime.GetDiffrenceToNow(DateTime.Now);
            var x9 = new PersianDateTime(1397, 1, 1);
            //var y7 = y6.AddWeeks(5);
            //var y8 = y7.AddYears(-5);
            //var y9 = y8.AddMonths(18);
            //var n = y8.ToLongStringHMS();
            //var n1 = y7.ToLongStringYMD();
            //var n2 = x4.ToLongStringYMDHM();
            //var n3 = x3.ToLongStringYMDHMS();
        }