Java Month Get getThisMonthAndCycle()

Here you can find the source of getThisMonthAndCycle()

Description

get This Month And Cycle

License

Open Source License

Declaration

public static int[] getThisMonthAndCycle() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static int[] getThisMonthAndCycle() {
        int cycle = 1;
        String str = new SimpleDateFormat("yyyyMMdd").format(new Date());
        int month = Integer.valueOf(str.substring(0, 6));
        int day = Integer.valueOf(str.substring(6, 8));
        if (day <= 10) {
            cycle = 1;//from   w w w  .  ja  v  a2  s. com
        }
        if (day > 10 && day <= 20) {
            cycle = 2;
        }
        if (day > 20) {
            cycle = 3;
        }
        return new int[] { month, cycle };
    }
}

Related

  1. getStrOfNextMonth(String dateStr)
  2. getStrThisMonth()
  3. getThisMonth()
  4. getThisMonth()
  5. getThisMonth()
  6. getThisMonthDate()
  7. getThisMonthLastDate()
  8. getTsOfMonth(Date date, boolean isEnd, boolean isPrevious)
  9. getWeekOfMonth(String datetime)