如何获得给定日期的当前星期和年份. [英] How to get current week and year for the given date..?
本文介绍了如何获得给定日期的当前星期和年份.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获得给定日期的当前星期和年份.
范例:我的约会日期为2011年7月23日.
我想显示"27-2011"(第27周)...
如何做到这一点...?
Hi,
How to get current week and year for the given date.
Example : I have the date 23/07/2011.
I want to display "27-2011"(27thWeek-Year)...
How to do this...?
推荐答案
使用GetWeekOfYear
获取 ^ ].
DateTime.Year
属性应该给您年份.
Use theGetWeekOfYear
to get the week of the year[^].
DateTime.Year
property should give you the year.
这篇关于如何获得给定日期的当前星期和年份.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文