Showing posts with label Simple C# code to get Quarters. Show all posts
Showing posts with label Simple C# code to get Quarters. Show all posts

Thursday, December 27, 2012

Simple C# code to get Quarters

 public static DateTime GetQuarterStartDate()  
     {  
       DateTime date = DateTime.Today;  
       int quarterNumber = ((date.Month - 1) / 3) + 1;  
       return new DateTime(date.Year, (quarterNumber - 1) * 3 + 1, 1);  
     }