'How to get quarter for future date using Carbon?

Simple question: How to get carbon get quarter for future date? Example: Given datetime: 2023-05-03 14:34:09 I want print which quarter will be using Carbon

Note: {{ $date->quarter }} works for 2018-11-04 17:40:05



Solution 1:[1]


{{ $date->year .'-Q' . $date->quarter }} 

gives 2023-Q2

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Snapey