DateTime dt = DateTime.Now;  //当前时间   DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") //24小时制  DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")  //12小时制     DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d&quo…
<?php        $week_begin = mktime(0, 0, 0,date("m"),date("d")-date("w")+1,date("Y"));$week_end = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y")); echo $week_begi…
/** * 获取本周.本季度.本月.上月的开始日期.结束日期 */ var now = new Date();                    //当前日期 var nowDayOfWeek = now.getDay();         //今天本周的第几天 var nowDay = now.getDate();              //当前日 var nowMonth = now.getMonth();           //当前月 var nowYear = now.getY…
/** * 获取本周.本季度.本月.上月的开始日期.结束日期 */ var now = new Date(); //当前日期  var nowDayOfWeek = now.getDay(); //今天本周的第几天  var nowDay = now.getDate(); //当前日  var nowMonth = now.getMonth(); //当前月  var nowYear = now.getYear(); //当前年  nowYear += (nowYear < 2000) ? 19…
/** * 日期工具类 */ public class DateUtils { /** * 获取今天 * @return String * */ public static String getToday(){ return new SimpleDateFormat("yyyy-MM-dd").format(new Date()); } /** * 获取昨天 * @return String * */ public static String getYestoday(){ Calend…
//获取本日 const startDate = moment().format('YYYY-MM-DD'); const startDate = moment().format('YYYY-MM-DD'); //获取本周 const startDate = moment().week(moment().week()).startOf('week').format('YYYY-MM-DD'); //这样是年月日的格式 const endDate = moment().week(moment().…
DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))); //本周周一 DateTime endWeek = startWeek.AddDays(6); //本周周日 DateTime startMonth = dt.AddDays(1 - dt.Day); //本月月初 DateTime endMonth =…
DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays( - Convert.ToInt32(dt.DayOfWeek.ToString("d"))); //本周周一 ); //本周周日 DateTime startMonth = dt.AddDays( - dt.Day); //本月月初 DateTime endMonth = startMonth.AddMonths().AddDays(-); //本月月…
/** * 获取本周.本季度.本月.上月的开端日期.停止日期 */ var now = new Date(); //当前日期 var nowDayOfWeek = now.getDay(); //今天本周的第几天 var nowDay = now.getDate(); //当前日 var nowMonth = now.getMonth(); //当前月 var nowYear = now.getYear(); //当前年 nowYear += (nowYear < 2000) ? 1900 :…
js 获取 本周.上周.本月.上月.本季度.上季度的开始结束日期 /**  * 获取本周.本季度.本月.上月的开始日期.结束日期  */ var now = new Date(); //当前日期 var nowDayOfWeek = now.getDay(); //今天本周的第几天 var nowDay = now.getDate(); //当前日 var nowMonth = now.getMonth(); //当前月 var nowYear = now.getYear(); //当前年 no…