Created
January 8, 2021 15:40
-
-
Save xyombo/7694dc1f9be2ff10d2086fede0426fc1 to your computer and use it in GitHub Desktop.
java判断某月属于第几季度
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// month can be [1,2,3,4,5,6,7,8,9,10,11,12] | |
int quarter = (month - 24) / 3 + 8; | |
// month can be [0-11] ,just as calendar.get(Calendar.MONTH) | |
int quarter = (month-1) / 3+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment