如何修复回历日历提前 1 天?
今天,我的时间 = 2013 年 7 月 23 日星期二
,伊斯兰日历时间 = 14 斋月,1434 年(据此
我的日历显示 15 斋月而不是 14。但是我不确定这是我的错还是网站的错。谁能确认今天的斋月日期?
lblgreg.Text = DateTime.Today.ToString("dd/MM/yyyy");
今天的日期:
DateTime today = DateTime.Today;
公历到 Hibri 的转换:
CultureInfo Hijri = CultureInfo.CreateSpecificCulture("ar-SA");
string datetoday_day = today.ToString("dd", Hijri);
string datetoday_month = today.ToString("MM", Hijri);
string datetoday_year = today.ToString("yyyy", Hijri);
int month_check = int.Parse(datetoday_month);
将月份值转换为文本月份的 Switch 语句:
switch (month_check) {
case 01:
{
lbldate.Text = datetoday_day + " Muharram " + datetoday_year;
break;
}
case 02:
{
lbldate.Text = datetoday_day + " Safar " + datetoday_year;
break;
}
case 03:
{
lbldate.Text = datetoday_day + " Rabi Al-Awwal " + datetoday_year;
break;
}
case 04:
{
lbldate.Text = datetoday_day + " Rabi Al-Akhar " + datetoday_year;
break;
}
case 05:
{
lbldate.Text = datetoday_day + " Jumada Al-Awwal " + datetoday_year;
break;
}
case 06:
{
lbldate.Text = datetoday_day + " Jumada Al-Akhirah " + datetoday_year;
break;
}
case 07:
{
lbldate.Text = datetoday_day + " Rajab " + datetoday_year;
break;
}
case 08:
{
lbldate.Text = datetoday_day + " Shaban " + datetoday_year;
break;
}
case 09:
{
lbldate.Text = datetoday_day + " Ramadan " + datetoday_year;
break;
}
case 10:
{
lbldate.Text = datetoday_day + " Shawwal " + datetoday_year;
break;
}
case 11:
{
lbldate.Text = datetoday_day + " Dhul-Qadah " + datetoday_year;
break;
}
case 12:
{
lbldate.Text = datetoday_day + " Dhul-Hijjah " + datetoday_year;
break;
}
}