最近发现Sql Server与.Net(C#)中星期值居然不匹配,倒不知道依哪一个了。
1、Sql Server
declare @date datetime; set @date = '2017-04-11';--实际为星期二 select DatePart(weekday,@date);
执行结果:
2、C#
#region 程序集 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 // C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.5mscorlib.dll #endregion using System.Runtime.InteropServices; namespace System { // // 摘要: // Specifies the day of the week. [ComVisible(true)] public enum DayOfWeek { // // 摘要: // Indicates Sunday. Sunday = 0, // // 摘要: // Indicates Monday. Monday = 1, // // 摘要: // Indicates Tuesday. Tuesday = 2, // // 摘要: // Indicates Wednesday. Wednesday = 3, // // 摘要: // Indicates Thursday. Thursday = 4, // // 摘要: // Indicates Friday. Friday = 5, // // 摘要: // Indicates Saturday. Saturday = 6 } }