如何获得给定日期的当前星期和年份. [英] How to get current week and year for the given date..?

查看:108
本文介绍了如何获得给定日期的当前星期和年份.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何获得给定日期的当前星期和年份.

范例:我的约会日期为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获取
Use the GetWeekOfYear to get the week of the year[^].

DateTime.Year property should give you the year.


这篇关于如何获得给定日期的当前星期和年份.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆