///
}
调用:
DateTime dt = Convert.ToDateTime("2013-1-6");
Dictionary
dict.Add("0001", DateTime.Now.AddDays(-100));
dict.Add("0002", DateTime.Now.AddDays(-99));
dict.Add("0003", DateTime.Now.AddDays(-98));
dict.Add("0004", DateTime.Now.AddDays(-97));
dict.Add("0005", DateTime.Now.AddDays(-96));
dict.Add("0006", DateTime.Now.AddDays(-95));
dict.Add("0007", DateTime.Now.AddDays(-94));
dict.Add("0008", DateTime.Now.AddDays(-93));
dict.Add("0009", DateTime.Now.AddDays(-92));
dict.Add("0010", DateTime.Now.AddDays(-91));
dict.Add("0011", DateTime.Now.AddDays(-90));
dict.Add("0012", DateTime.Now.AddDays(-89));
dict.Add("0013", DateTime.Now.AddDays(-88));
dict.Add("0014", DateTime.Now.AddDays(-87));
dict.Add("0015", DateTime.Now.AddDays(-86));
dict.Add("0016", DateTime.Now.AddDays(-85));
dict.Add("0017", DateTime.Now.AddDays(0));
dict.Add("0018", DateTime.Now.AddDays(1));
dict.Add("0019", DateTime.Now.AddDays(2));
string str = "";
foreach(KeyValuePair
{
DateTime[] dts = Common.OperateText.DatesIncludeDay(kv.Value);
str = str + string.Format("{0},第{1}周,时间{2:yyyy-MM-dd},本周从{3:yyyy-MM-dd}到{4:yyyy-MM-dd}
",kv.Key,Common.OperateText.WeekOfYear(kv.Value),kv.Value,dts[0],dts[1]);
}
Response.Write(str);
效果: