JS
var now = new Date();
var firstDate = new Date(now.getFullYear(),now.getMonth+1,1);
var lastDate = new Date(now.getFullYear(),now.getMonth+1,0);
C#
var firstDate = DateTime.Now.AddDays(1 - DateTime.Now.Day)
var lastDate = DateTime.Now.AddDays(1 - DateTime.Now.Day).Date.AddMonths(1).AddDays(-1)
原创文章如转载,请注明出处“
伊人博客”