C#取当天年月日以及取前7天年月日的方法

来源:互联网 发布:淘宝店铺经营技巧sohu 编辑:程序博客网 时间:2024/04/30 06:14
 DateTime dt = DateTime.Now;
 dt.ToShortDateString();//本天
 dt.AddDays(-7).ToShortDateString();//前7天