本文整理汇总了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;
}
示例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));
}
示例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;
}