C#中的年、月、日、星期转换方法

 public static void WeekDayID2WeekDayString(Literal L)
    {
        string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };

        L.Text = DateTime.Now.ToString("yyyy年MM月dd日") + " " + Day[Convert.ToInt16(DateTime.Now.DayOfWeek)].ToString() ;
    }
发表评论 / Comment

用心评论~