reference:http://www.cnblogs.com/coconut_zhang/archive/2009/02/02/1382598.html http://blog.itpub.net/14766526/viewspace-1156100/ select GETDATE() as '当前日期',DateName(year,GetDate()) as '年',DateName(month,GetDate()) as '月',DateName(day,GetDate()) as '日
var nowdays = new Date(); var year = nowdays.getFullYear(); var month = nowdays.getMonth(); if(month==0){ month = 12; year = year-1; } if(month<10){ month = '0'+month; } var myDate = new Date(year,month,0); var startDate = year+'-'+month+'-01 00:00:0
nterval 参数,具有以下设定值: 设置 描述 Year yy, yyyy 年 quarter qq, q 季 Month mm, m 月 dayofyear dy, y 一年的日数 Day dd, d 日 Week wk, ww 一周的日数 Hour hh 小时 minute mi, n 分钟 second ss, s 秒 millisecond ms 毫秒 ①本周的星期一 这里我是用周(wk)的时间间隔来计算哪一天是本周的星期一. SELECT DATEADD(wk, DATEDIFF(