Java Year yearAndSeason(Date date)

Here you can find the source of yearAndSeason(Date date)

Description

year And Season

License

Apache License

Declaration

public static String yearAndSeason(Date date) 

Method Source Code

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

import java.util.*;

public class Main {

    public static String yearAndSeason(Date date) {
        final Calendar cal = Calendar.getInstance();
        cal.setTime(date);/*from w  w  w  .j av a2  s. c  o m*/

        return yearAndSeason(cal);
    }

    private static String yearAndSeason(Calendar cal) {
        return new StringBuilder().append(cal.get(Calendar.YEAR)).append(cal.get(Calendar.MONTH) / 3 + 1)
                .toString();
    }
}

Related

  1. diffYears(Date day1, Date day2)
  2. IsInLeapYear(Date date1)
  3. isLeapYear(int year)
  4. nextYears(int diff)
  5. sameYear(Date date1, Date date2)