zoukankan      html  css  js  c++  java
  • .将DayOfWeek转换成中文的几种方式

    最傻的一种:
    string WeekDay = "";
                switch (date.DayOfWeek)
                {
                    case DayOfWeek.Monday:
                        WeekDay = "星期一";
                        break;
                    case DayOfWeek.Friday:
                        WeekDay = "星期五";
                        break;
                    case DayOfWeek.Saturday:
                        WeekDay = "星期六";
                        break;
                    case DayOfWeek.Sunday:
                        WeekDay = "星期日";
                        break;
                    case DayOfWeek.Thursday:
                        WeekDay = "星期四";
                        break;
                    case DayOfWeek.Tuesday:
                        WeekDay = "星期二";
                        break;
                    case DayOfWeek.Wednesday:
                        WeekDay = "星期三";
                        break;
                }
    第二傻:
    string [] Day=new string []{"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
    Console.WriteLine(Day[Convert.ToInt16(DateTime.Now.DayOfWeek)]);
    再次
    const string Day = "日一二三四五六";
    Console.WriteLine("星期" + Day[Convert.ToInt16(DateTime.Now.DayOfWeek)]);
    最后
    System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek)
  • 相关阅读:
    Django 路由层
    HTTP协议
    Python并发编程之协程
    Django配置KindEditor
    Django Form
    pymysql模块
    javascript获取URL参数代码(网络摘抄)
    javascript 实现飘动的广告(网络收藏,转)
    游标的使用
    javascript 一个很好用的日历控件(网络收藏,转)
  • 原文地址:https://www.cnblogs.com/jkyweb/p/2094695.html
Copyright © 2011-2022 走看看