Rohit Gupta

Engaging talk on Microsoft Technologies ....My Resume

  Home  |   Contact  |   Syndication    |   Login
  39 Posts | 0 Stories | 52 Comments | 0 Trackbacks

News



Twitter












Archives

Image Galleries

Personal

January 2010 Entries

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:...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati