-- 计算指定日期本周的第一天和最后一天 select day ,dayofweek(day) as dw1 ,date_add( - dayofweek(day)) as Su_s -- 周日_start ,date_add( - dayofweek(day)) as Sa_e -- 周六_end , end as dw2 ,date_add( end) as Mo_s -- 周一_start ,date_add( end) as Su_e -- 周日_end from ( select '2…
NthDayOfWeek 计算并返回指定日期是该月第几周 Unit:DateUtils function NthDayOfWeek(const AValue: TDateTime): Word; Example: Uses SysUtils,DateUtils; Begin Write('Today is the ',NthDayOfWeek(Today),'-th '); Writeln(formatdateTime('dddd',Today),' of the month.');En…
function getNextDate(date,day) { var dd = new Date(date); dd.setDate(dd.getDate() + day); var y = dd.getFullYear(); var m = dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1; var d = dd.getDate() < 10 ? "0" +…