Java Month Calculate getThisMonthStart()

Here you can find the source of getThisMonthStart()

Description

get This Month Start

License

Open Source License

Declaration

public static String getThisMonthStart() 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {

    public static String getThisMonthStart() {
        String strY = null;/*from   w w w. j  a  va  2  s .  c o m*/
        Calendar localTime = Calendar.getInstance();
        int x = localTime.get(Calendar.YEAR);
        int y = localTime.get(Calendar.MONTH) + 1;
        strY = y >= 10 ? String.valueOf(y) : ("0" + y);
        return x + "-" + strY + "-01";
    }
}

Related

  1. getNextMonth(long date)
  2. getNextMonthExtention(Date dt, Long n)
  3. getNowMonth()
  4. getStartOfMonth(Calendar scal)
  5. getThisMonthEnd()
  6. incrementMonth(long date, int increment)
  7. intToCalendarMonth(int month)
  8. isFirstOfMonth(long date)
  9. isMonthEnd(Date date)