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
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WL.Infrastructure.Commom { public class Time { /// 取得某月的第一天 /// </summary> /// <param name="datetime">要取得月份