标签:c# convert oda get nbsp bsp 时间 parse ret
int getWeek(DateTime dt)
{
DateTime time = Convert.ToDateTime(dt.ToString("yyyy") + "-01-01");
TimeSpan ts = dt - time;
int iii = (int)time.DayOfWeek;
int day = int.Parse(ts.TotalDays.ToString("F0"));
if (iii == 0)
{
day--;
}
else
{
day = day - (7 - iii) - 1;
}
int week = ((day + 7) / 7) + 1;
return week;
}
标签:c# convert oda get nbsp bsp 时间 parse ret
原文地址:http://www.cnblogs.com/huangzebin/p/6265779.html