Example usage for java.util Calendar getInstance

List of usage examples for java.util Calendar getInstance

Introduction

In this page you can find the example usage for java.util Calendar getInstance.

Prototype

public static Calendar getInstance() 

Source Link

Document

Gets a calendar using the default time zone and locale.

Usage

From source file:Main.java

public static long getNowTime() {
    return Calendar.getInstance().getTime().getTime() / 1000;
}

From source file:Main.java

public static int getDayOfWeek() {
    return Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
}

From source file:Main.java

public static int getCurYear() {
    return Calendar.getInstance().get(Calendar.YEAR);
}

From source file:Main.java

public static int getCurMonth() {
    return Calendar.getInstance().get(Calendar.MONTH) + 1;
}

From source file:Main.java

public static long now() {
    Calendar cal = Calendar.getInstance();
    return cal.getTimeInMillis();
}

From source file:Main.java

public static int getWeekOfMonth() {
    return Calendar.getInstance().get(Calendar.DAY_OF_WEEK_IN_MONTH);
}

From source file:Main.java

public static int getCurrentDay() {
    return Calendar.getInstance().get(Calendar.DATE);
}

From source file:Main.java

public static String year() {
    Calendar cal = Calendar.getInstance();
    return String.valueOf(cal.get(Calendar.YEAR));
}

From source file:Main.java

public static int getCurrentYear() {
    return Calendar.getInstance().get(Calendar.YEAR);

}

From source file:Main.java

public static int getCurrentMonthDay() {
    return Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
}