C# 获取日期星期几方法

 

/// <summary>
/// 计算日期星期几
/// </summary>
/// <param name="dtNow">日期(DateTime类型)</param>
/// <returns></returns>
public string CaculateWeekDay(DateTime dtNow)
{
    var weekdays = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
    return weekdays[(int)dtNow.DayOfWeek];
}
上一篇:持续集成与持续交付CI&CD


下一篇:spark_(spark for windows)spark_shell.cmd启动失败ಥ_ಥ/关闭java8更新提示