Skip to content

Instantly share code, notes, and snippets.

@xyombo
Created January 8, 2021 15:40
Show Gist options
  • Save xyombo/7694dc1f9be2ff10d2086fede0426fc1 to your computer and use it in GitHub Desktop.
Save xyombo/7694dc1f9be2ff10d2086fede0426fc1 to your computer and use it in GitHub Desktop.
java判断某月属于第几季度
// 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