取得上个月月初日期

//取得上个月 int lastMonth = DateTime.Now.Month - 1 == 0 ? 12 : DateTime.Now.Month - 1; //取得上个月月初日期 string lastMonthDate = (DateTime.Now.Month - 1 == 0 ? Convert.ToString(DateTime.Now.Year - 1) : DateTime.Now.Year.ToString()) + "-" + lastMonth.ToString() + "-" + "1";
posted @ 2008-01-09 16:17  狐狸马三  阅读(333)  评论(0编辑  收藏  举报