@@ -118,7 +118,7 @@ addition of their components::
118118 $time = DateTime::create(2021, 1, 31, 22, 11, 30);
119119 $newTime = $time->subDays(5)
120120 ->addHours(-2)
121- ->addMonth (1);
121+ ->addMonths (1);
122122 // Outputs '2/26/21, 8:11 PM'
123123 echo $newTime;
124124
@@ -342,6 +342,7 @@ Conversion
342342==========
343343
344344.. php :method :: toQuarter()
345+ .. php :method :: toQuarterRange()
345346
346347 Once created, you can convert ``DateTime `` instances into timestamps or quarter
347348values::
@@ -350,6 +351,19 @@ values::
350351 echo $time->toQuarter(); // Outputs '1'
351352 echo $time->toUnixString(); // Outputs '1612069200'
352353
354+ .. versionadded :: 5.3.0
355+ The ``toQuarterRange() `` method was added.
356+
357+ You can also get the date range for a quarter::
358+
359+ $time = new DateTime('2021-01-31');
360+ $range = $time->toQuarterRange();
361+ // Outputs ['2021-01-01', '2021-03-31']
362+
363+ $time = new DateTime('2021-12-25');
364+ $range = $time->toQuarterRange();
365+ // Outputs ['2021-10-01', '2021-12-31']
366+
353367Comparing With the Present
354368==========================
355369
0 commit comments