Here you can find the source of getQuarterlyKey(Date d)
public static String getQuarterlyKey(Date d)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static String getQuarterlyKey(Date d) { Calendar c = Calendar.getInstance(); c.setTime(d);/*from w ww . j a v a2 s. co m*/ int month = c.get(Calendar.MONTH); int q = (((month + 1) / 3) + 3) % 4 + 1; int fy = c.get(Calendar.YEAR); if (month >= 2) { fy++; } return "FY" + fy + "_Q" + q; } }