Java Date to Quarter getQuarterOfDay(Date day)

Here you can find the source of getQuarterOfDay(Date day)

Description

get Quarter Of Day

License

Apache License

Declaration

private static int getQuarterOfDay(Date day) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;

public class Main {

    private static int getQuarterOfDay(Date day) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(day);//from w  w  w  .j av a 2  s  .  com
        int month = calendar.get(Calendar.MONTH);
        return month / 3;
    }
}

Related

  1. getQuarter(Date date)
  2. getQuarterBounds(final Date date)
  3. getQuarterlyKey(Date d)
  4. getQuarterNum(Date date)
  5. getQuarterNum(Date dt)
  6. getQuarterStart(Date date)
  7. getQuarterYear(Date dateParam)
  8. getQuaterStart(Date date)