close
這好用的類別要記錄一下!!
using System.Globalization;
GregorianCalendar gc = new GregorianCalendar(); int year = 2011 , month=10; int days = gc.GetDaysInMonth(year, month); // 依指定年、月找出天數 //↓ 取得某一日期在當年的第幾週 int weeks = gc.GetWeekOfYear(DateTime.Now, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
MSDN: http://msdn.microsoft.com/zh-tw/library/system.globalization.gregoriancalendar(v=VS.100).aspx
全站熱搜
留言列表