Here you can find the source of getQuarter(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static int getQuarter(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int getQuarter(Date date) { Calendar cld = Calendar.getInstance(); cld.setTime(date);// ww w .j ava 2 s .co m Double dd = new Double(Math.floor(cld.get(Calendar.MONTH) / 3)); return dd.intValue() + 1; } }