public DateTime ReturnGregorianDate(string am_date) { _date = am_date.Split('-'); var ethDate = new EthiopianDate(int.Parse(_date[2]), EthiopianDate.GetMonthNo(_date[1]), int.Parse(_date[0])); ConvertedDate = ethDate.ToGregorianDate(); return ConvertedDate; }
public DateTime ReturnGregorianDate(string am_date) { _date = am_date.Split('-'); var ethDate = new EthiopianDate(int.Parse(_date[2]), EthiopianDate.GetMonthNo(_date[1]), int.Parse(_date[0])); ConvertedDate = ethDate.ToGregorianDate(); return(ConvertedDate); }
public static string ToCTSPreferedDateFormat(this DateTime date, string lang) { if (lang.ToLower() == "gc") { IFormatProvider provider = new CultureInfo("en-GB"); return date.ToString("dd-MMM-yyyy", provider); } else { EthiopianDate ethiopianDate = new EthiopianDate(date); return ethiopianDate.ToLongDateString(); } }
public static string ToCTSPreferedDateFormat(this DateTime date, string lang) { if (date.Date.Equals(DateTime.Parse("1/1/0001"))) { return(string.Empty); } if (lang.ToLower() == "gc") { IFormatProvider provider = new CultureInfo("en-GB"); return(date.ToString("dd-MMM-yyyy", provider)); } else { EthiopianDate ethiopianDate = new EthiopianDate(date); return(ethiopianDate.ToLongDateString()); } }