用于 Date 对象的有用扩展方法 C# 库
你们能给我推荐一个库来处理 C# 中 Date
对象最常见的缺失功能吗?
.. 诸如计算出:
- 给定日期是哪个季度
- 获取给定季度/月/周的开始/结束
- 各种减法和加法
注意:将其功能实现为扩展的库方法将是一个优点。
Could you guys recommend me a library which handles the most common missing features for the Date
object in C#?
.. Things like figuring out:
- What quarter a given date is in
- Get the start/end of a given quarter/month/week
- Various subtraction -and addition methods
Note: A library which implements its features as extension methods would be a plus.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这篇文章中有一些有趣的日期时间扩展方法(特别是加法/减法):发布您的 C# .Net 扩展好东西。
特别检查基于日期时间的扩展库的第一个答案。这些方法正在 CodePlex 项目中收集,也许值得一看。
There are some interesting datetime extension methods (especially for addition/subtraction) in this post: Post your extension goodies for C# .Net.
Check in particular the first answer for datetime-based extension libraries. The methods are being collected in a CodePlex project, maybe it's worth having a look.
这是我对 DateTime 类型的扩展方法的尝试。你可以从sourceforge下载它 https://sourceforge.net/projects/xtensionsuite/
我也提供了到目前为止我已在该套件中添加的方法列表,以及我的博客中的一些示例。 http://lazypro.nallenthal.in/ganesh-periasamy/english/ coding/xtensionsuite-1/
希望这会有所帮助! :)
Here is my attempt on extension methods for DateTime type. You can download it from sourceforge https://sourceforge.net/projects/xtensionsuite/
Also I have provided the list of methods so far I have added in this suite, and some examples in my blog. http://lazypro.nallenthal.in/ganesh-periasamy/english/coding/xtensionsuite-1/
hope this will help! :)
我自己还没用过,但 Jon Skeet 是 Noda Time 的幕后推手,该库旨在更轻松地管理 C# 日期和时间。野田时间基于 乔达时间。专门的 Noda Time 博客可以提供有价值的见解。
Haven't used it myself, but Jon Skeet is behind Noda Time, library designed to manage C# dates and times easier. Noda Time is based on Joda Time. Dedicated Noda Time blog can provide valuable insights.