GetDayOfWeek() public method

public GetDayOfWeek ( System.DateTime time ) : DayOfWeek
time System.DateTime
return DayOfWeek
Beispiel #1
0
        public int GetDayNumber(int Day)
        {
            try
            {
                switch (UmAlQuraInstance.GetDayOfWeek(new System.DateTime(m_selectedYear, m_selectedMonth, Day, UmAlQuraInstance)))
                {
                case DayOfWeek.Saturday:
                    return(0);

                case DayOfWeek.Sunday:
                    return(1);

                case DayOfWeek.Monday:
                    return(2);

                case DayOfWeek.Tuesday:
                    return(3);

                case DayOfWeek.Wednesday:
                    return(4);

                case DayOfWeek.Thursday:
                    return(5);

                case DayOfWeek.Friday:
                    return(6);
                }
            }
            catch (ArgumentException exception)
            {
                MessageBox.Show(exception.Message);
            }
            return(0);
        }
Beispiel #2
0
 public static string GregToHijri(DateTime dtTime)
 {
     if (dtTime == DateTime.MinValue)
         return "";
     UmAlQuraCalendar calHijri = new UmAlQuraCalendar();
     string weekday = Convert.ToString(calHijri.GetDayOfWeek(dtTime));
     int CurrDayOfMonth = calHijri.GetDayOfMonth(dtTime);
     int CurrMonth = calHijri.GetMonth(dtTime);
     int Curryear = calHijri.GetYear(dtTime);
     return CurrDayOfMonth.ToString() + "/" + CurrMonth.ToString() + "/" + Curryear.ToString();
 }
Beispiel #3
0
 public static string GregToHijriCompleteWithDay(DateTime dtTime)
 {
     if (dtTime == DateTime.MinValue)
         return "";
     UmAlQuraCalendar calHijri = new UmAlQuraCalendar();
     CultureInfo info = new CultureInfo("ar-sa");
     info.DateTimeFormat.Calendar = calHijri;
     string weekday = Convert.ToString(calHijri.GetDayOfWeek(dtTime));
     int CurrDayOfMonth = calHijri.GetDayOfMonth(dtTime);
     int CurrMonth = calHijri.GetMonth(dtTime);
     int Curryear = calHijri.GetYear(dtTime);
     return string.Format("{0} {3}/{2}/{1}  هـ ", dtTime.ToString("dddd", info), CurrDayOfMonth.ToString(), CurrMonth.ToString(), Curryear.ToString());
 }
Beispiel #4
0
 public static string GregToHijriTime(DateTime dtTime)
 {
     if (dtTime == DateTime.MinValue)
         return "";
     UmAlQuraCalendar calHijri = new UmAlQuraCalendar();
     CultureInfo info = new CultureInfo("ar-sa");
     info.DateTimeFormat.Calendar = calHijri;
     string weekday = Convert.ToString(calHijri.GetDayOfWeek(dtTime));
     int CurrDayOfMonth = calHijri.GetDayOfMonth(dtTime);
     int CurrMonth = calHijri.GetMonth(dtTime);
     int Curryear = calHijri.GetYear(dtTime);
     return dtTime.ToString("hh:mm tt", info);
 }