Olá,
Qual a diferença entre Calendar.DATE e Calendar.DAY_OF_MONTH ?
Olá,
Qual a diferença entre Calendar.DATE e Calendar.DAY_OF_MONTH ?
Olá Felipe, como vai?
ao que me parece são a mesma coisa... veja a documentação:
Calendar.DATE:
Field number for get and set indicating the day of the month. This is a synonym for DAY_OF_MONTH. The first day of the month has value 1. See Also: DAY_OF_MONTH < 1.8 >
Calendar.DAY_OF_MONTH:
Field number for get and set indicating the day of the month. This is a synonym for DATE. The first day of the month has value 1. See Also: DATE < 1.8 >
Executando o código abaixo teremos os mesmos valores:
import java.util.Calendar;
public class TesteCalendarJava {
public static void main(String[] args) {
// create a calendar
Calendar cal = Calendar.getInstance();
int a1 = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
System.out.println("ActualMaximum day DAY_OF_MONTH:" + a1);
int date = cal.getActualMaximum(Calendar.DATE);
System.out.println("ActualMaximum day DATE:" + date);
}
}