BB.Caching.Redis.Analytics.BitwiseAnalytics.DateTimeUtil.MonthsInQuarter C# (CSharp) Method

MonthsInQuarter() private method

private MonthsInQuarter ( System.DateTime dateTime ) : string[]
dateTime System.DateTime
return string[]
            public static string[] MonthsInQuarter(DateTime dateTime)
            {
                int quarter = (dateTime.Month + 2) / 3;
                DateTime tmp = dateTime.AddMonths(-(dateTime.Month - 1));
                tmp = tmp.AddMonths((3 * quarter) - 3);

                return new[]
                           {
                               string.Format("{0:yyyyMM}", tmp),
                               string.Format("{0:yyyyMM}", tmp.AddMonths(1)),
                               string.Format("{0:yyyyMM}", tmp.AddMonths(2))
                           };
            }