Geeks With Blogs
Rohit Gupta Engaging talk on Microsoft Technologies ....My Resume
January 2010 Entries
Getting Last Quarter end and Next Quarter End Extension methods
I wrote these utility extension methods to get the previous quarter end/month end and next quarter end/month end values for Financial calculations. Next Quarter End: 1: public static DateTime NextQuarterEnd(this DateTime date) 2: { 3: IEnumerable<DateTime> candidates = 4: QuartersInYear(date.Year).U... + 1)); 5: return candidates.Where(d => d.Subtract(date).Days > 0).First(); 6: } 7: 8: public static IEnumerable<DateTime> QuartersInYear(int year) 9: { 10: ......

Posted On Thursday, January 7, 2010 12:02 PM

Copyright © Rohit Gupta | Powered by: GeeksWithBlogs.net