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.


//  w ww.j  a  v a2  s.co m
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.