Java Date Time - Java Calendar WEEK_OF_MONTH








Syntax

Calendar.WEEK_OF_MONTH has the following syntax.

public static final int WEEK_OF_MONTH

Example

In the following code shows how to use Calendar.WEEK_OF_MONTH field.

//ww w.  ja v a2s  .c om
import java.util.Calendar;

public class Main {
  public static void main(String[] args) {
    Calendar now = Calendar.getInstance();
    System.out.println(now.getTime());

    System.out.println(now.get(Calendar.WEEK_OF_MONTH));

  }
}

The code above generates the following result.