当前位置: 首页>>代码示例>>C#>>正文


C# PersianCalendar.GetDayOfWeek方法代码示例

本文整理汇总了C#中System.Globalization.PersianCalendar.GetDayOfWeek方法的典型用法代码示例。如果您正苦于以下问题:C# PersianCalendar.GetDayOfWeek方法的具体用法?C# PersianCalendar.GetDayOfWeek怎么用?C# PersianCalendar.GetDayOfWeek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Globalization.PersianCalendar的用法示例。


在下文中一共展示了PersianCalendar.GetDayOfWeek方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToLongPersianDateStringPersianDigit

        public string ToLongPersianDateStringPersianDigit(DateTime? date)
        {
            if (date == null)
                return string.Empty;

            var calendar = new PersianCalendar();

            var day = calendar.GetDayOfMonth(date.Value);
            var dayOfWeek = calendar.GetDayOfWeek(date.Value);
            var month = calendar.GetMonth(date.Value);
            var year = calendar.GetYear(date.Value);

            var persianString = string.Format("{0} {1} {2} {3}", GetPersianNameOfWeek(dayOfWeek),
                                              FConvert.ToPersianDigit(day), GetPersianNameOfMonth(month),
                                              FConvert.ToPersianDigit(year));

            return persianString;
        }
开发者ID:arabsoheyl,项目名称:fardis,代码行数:18,代码来源:DateTimeHelper.cs

示例2: PersianDat

 public string PersianDat(DateTime Mdate)
 {
     PersianCalendar ps = new PersianCalendar();
     return string.Format(" {2}/{1}/{0}", ps.GetDayOfMonth(Mdate),
     ps.GetMonth(Mdate), ps.GetYear(Mdate), ps.GetDayOfWeek(Mdate));
 }
开发者ID:rad-navid,项目名称:forms-automation,代码行数:6,代码来源:FrmEghdamPaghohi.cs

示例3: ShowDate

        private void ShowDate()
        {
            PersianCalendar p = new PersianCalendar();
            int year = p.GetYear(DateTime.Now);
            int month = p.GetMonth(DateTime.Now);
            int day = p.GetDayOfMonth(DateTime.Now);

            string str = "امروز ";
            DayOfWeek d = p.GetDayOfWeek(DateTime.Now);
            switch (d)
            {
                case DayOfWeek.Friday: { str += " جمعه "; break; }
                case DayOfWeek.Monday: { str += " دوشنبه "; break; }
                case DayOfWeek.Saturday: { str += " شنبه "; break; }
                case DayOfWeek.Sunday: { str += " یکشنبه "; break; }
                case DayOfWeek.Thursday: { str += " پنجشنبه "; break; }
                case DayOfWeek.Tuesday: { str += " سه شنبه "; break; }
                case DayOfWeek.Wednesday: { str += " چهارشنبه "; break; }
            }
            str += day + " ";
            string[] ListMonth = { "فروردین ماه", "اردیبهشت ماه", " خردادماه ", " تیرماه ", " مردادماه ", " شهریورماه ", " مهرماه ", " آبان ماه ", " آذرماه ", " دی ماه ", " بهمن ماه ", " اسفندماه " };
            str += ListMonth[month - 1];
            str += " سال " + year;
            DateLable.Text = str;
        }
开发者ID:NavidDorfeshan,项目名称:WinFormapp_EsfahanGhos,代码行数:25,代码来源:Form_MainMenu.cs


注:本文中的System.Globalization.PersianCalendar.GetDayOfWeek方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。