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

Publicado el: 31 julio 2023
en el 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);
}


En esta página del sitio puede ver el video en línea Java program to display date and time, print date and time using java program. de Duración hora minuto segunda en buena calidad , que subió el usuario The Disciplined learner 31 julio 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 3,922 veces y le gustó 86 a los espectadores. Disfruta viendo!