ASP.NET星期显示成中文
protectedvoidPage_Load(objectsender,EventArgse){this.labdate.Text=System.DateTime.Now...
protected void Page_Load(object sender, EventArgs e)
{
this.labdate.Text = System.DateTime.Now.ToString("yyyy年MM月dd日") + " " + System.DateTime.Now.DayOfWeek.ToString();
}
我写了这样一句代码,星期显示为sunday
怎么让sunday显示成星期天?也就是把英文显示成中文 展开
{
this.labdate.Text = System.DateTime.Now.ToString("yyyy年MM月dd日") + " " + System.DateTime.Now.DayOfWeek.ToString();
}
我写了这样一句代码,星期显示为sunday
怎么让sunday显示成星期天?也就是把英文显示成中文 展开
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
protected void Page_Load(object sender, EventArgs e)
{
LabelShow.Text = Get_Chinese_Week();
}
public string Get_Chinese_Week()
{
string Chinese_Week=string.Empty;
switch (Convert.ToInt32(DateTime.Today.DayOfWeek))
{
case 0: Chinese_Week = "星期日"; return Chinese_Week;
case 1: Chinese_Week = "星期一"; return Chinese_Week;
case 2: Chinese_Week = "星期二"; return Chinese_Week;
case 3: Chinese_Week = "星期三"; return Chinese_Week;
case 4: Chinese_Week = "星期四"; return Chinese_Week;
case 5: Chinese_Week = "星期五"; return Chinese_Week;
case 6: Chinese_Week = "星期六"; return Chinese_Week;
default: return Chinese_Week;
}
}
输出中文日期
{
LabelShow.Text = Get_Chinese_Week();
}
public string Get_Chinese_Week()
{
string Chinese_Week=string.Empty;
switch (Convert.ToInt32(DateTime.Today.DayOfWeek))
{
case 0: Chinese_Week = "星期日"; return Chinese_Week;
case 1: Chinese_Week = "星期一"; return Chinese_Week;
case 2: Chinese_Week = "星期二"; return Chinese_Week;
case 3: Chinese_Week = "星期三"; return Chinese_Week;
case 4: Chinese_Week = "星期四"; return Chinese_Week;
case 5: Chinese_Week = "星期五"; return Chinese_Week;
case 6: Chinese_Week = "星期六"; return Chinese_Week;
default: return Chinese_Week;
}
}
输出中文日期
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询