Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Useful extension methods C# library for the Date object

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.

like image 921
cllpse Avatar asked Jan 29 '26 14:01

cllpse


2 Answers

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.

like image 129
Paolo Tedesco Avatar answered Jan 31 '26 04:01

Paolo Tedesco


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! :)

like image 33
Ganesh Avatar answered Jan 31 '26 05:01

Ganesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!