如何根据特定日期获取周号? [英] How to get weekno.s based on the particular date?
本文介绍了如何根据特定日期获取周号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi,
How to get weekno.s based on the particular date?
推荐答案
查看MSDN
http://msdn.microsoft.com/zh-cn/library/system.globalization.calendar.getweekofyear.aspx
Check out MSDN
http://msdn.microsoft.com/en-us/library/system.globalization.calendar.getweekofyear.aspx
尝试一下:
try this :
public static int GetWeekNumber(DateTime dtPassed)
{
CultureInfo ciCurr = CultureInfo.CurrentCulture;
int weekNum = ciCurr.Calendar.GetWeekOfYear(dtPassed, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
return weekNum;
}
希望对您有所帮助:)
hope it helps :)
这篇关于如何根据特定日期获取周号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文