Example usage for java.util Calendar DAY_OF_MONTH

List of usage examples for java.util Calendar DAY_OF_MONTH

Introduction

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

Prototype

int DAY_OF_MONTH

To view the source code for java.util Calendar DAY_OF_MONTH.

Click Source Link

Document

Field number for get and set indicating the day of the month.

Usage

From source file:Main.java

public static void toBeginOfMonth(Calendar cal) {
    cal.set(Calendar.DAY_OF_MONTH, 1);
}

From source file:Main.java

public static Calendar getNextDay(Calendar day) {
    day.add(Calendar.DAY_OF_MONTH, 1);
    return day;
}

From source file:Main.java

public static String getDate() {
    return Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + " ";
}

From source file:Main.java

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

From source file:Main.java

public static String toDateString(Calendar date) {
    int day = date.get(Calendar.DAY_OF_MONTH);
    int month = date.get(Calendar.MONTH);
    int year = date.get(Calendar.YEAR);
    return day + "/" + (month + 1) + "/" + year;
}

From source file:Main.java

public static boolean isSameOnlyDay(Calendar start, Calendar end) {
    return start.get(Calendar.DAY_OF_MONTH) == end.get(Calendar.DAY_OF_MONTH);
}

From source file:Main.java

public static Calendar addDays(long time, int days) {
    return add(time, days, Calendar.DAY_OF_MONTH);
}

From source file:Main.java

public static String buildDateForUrl(Calendar calendar) {
    String day = (calendar.get(Calendar.DAY_OF_MONTH) < 10 ? "0" : "") + calendar.get(Calendar.DAY_OF_MONTH);
    String month = ((calendar.get(Calendar.MONTH) + 1) < 10 ? "0" : "") + (calendar.get(Calendar.MONTH) + 1);
    return calendar.get(Calendar.YEAR) + "" + month + "" + day;
}

From source file:Main.java

static int day() {
    return (new GregorianCalendar()).get(Calendar.DAY_OF_MONTH);
}

From source file:Main.java

public static Calendar dataFimMesAtual() {
    Calendar data = Calendar.getInstance();
    data.set(Calendar.DAY_OF_MONTH, data.getMaximum(Calendar.DAY_OF_MONTH));
    return data;//from w w w.j  av  a 2s  .  c o m
}