Java program to display date and time, print date and time using java program.

Publicado em: 31 Julho 2023
no canal de: The Disciplined learner
3,922
86

Java date and time program :- Java code to print or display current system date and time. This program prints current date and time. We are using GregorianCalendar class in our program. Java code to print date and time is given below :
public static void main(String[] args) {
int Day,Month,Year;
int Second,Minute,Hour;
GregorianCalendar date=new GregorianCalendar();
Day=date.get(Calendar.DAY_OF_MONTH);
Month=date.get(Calendar.MONTH);
Year=date.get(Calendar.YEAR);
Second=date.get(Calendar.SECOND);
Minute=date.get(Calendar.MINUTE);
Hour=date.get(Calendar.HOUR);
System.out.println("Current Date is :"+Day+"/"+(Month+1)+"/"+Year);
System.out.println("Current Time is :"+Hour+":"+Minute+":"+Second);
}


Nesta página do site você pode assistir ao vídeo on-line Java program to display date and time, print date and time using java program. duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário The Disciplined learner 31 Julho 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 3,922 vezes e gostou 86 espectadores. Boa visualização!