我有一个提取日期信息的网络应用程序。我想要的是提取全年的周数。
DateTime nicole = new DateTime();
for (int i = 1; i <= 366; i++)
{
System.Globalization.CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
Int32 weekNo = ci.Calendar.GetWeekOfYear(
new DateTime(nicole.Year,nicole.Month,nicole.Day),
ci.DateTimeFormat.CalendarWeekRule,
ci.DateTimeFormat.FirstDayOfWeek
);
response.write(ci);
}
结果是
en-USen-USen-USen-USen-USen-USen-USen-USen-USen-USen-USen-USen-USen-USen-USen-USen-
请帮忙!