/// <summary> /// Return PersianDate object that bind from persian string date /// </summary> /// <param name="PersianStringDate">it must be complete like 1392/01/01 </param> /// <returns></returns> public static PersianDate GetDate(string PersianStringDate) { PersianDate PD = new PersianDate(); PD.PersianDateString = PersianStringDate; return(PD); }
public static PersianDate ToPersian(this DateTime date) { try { return(PersianDate.GetDate(date)); } catch { return(null); } }
public static string ToPersianShort(this DateTime date, bool ContainsTime = false) { try { return(PersianDate.GetDate(date).ToShortString() + " " + (ContainsTime ? date.ToString("HH:mm:ss") : "")); } catch { return(""); } }
public PersianDate AddYears(int count) { return(PersianDate.GetDate(this.MiladyDate.AddYears(count))); }