2016年6月2日 星期四

[asp.net]一些日期應用

  1. //取得 上個月月底的天數
  2. string lastMonth = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.AddMonths(-1).Month).ToString()
  3.  
  4. //取得現在時間的日期
  5. int nowDate = DateTime.Now.Day
  6.  

沒有留言:

張貼留言