Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

l datetime anne month jour heure minute second in java

Calendar now = Calendar.getInstance();
int year = now.get(Calendar.YEAR);
int month = now.get(Calendar.MONTH); // Note: zero based!
int day = now.get(Calendar.DAY_OF_MONTH);
int hour = now.get(Calendar.HOUR_OF_DAY);
int minute = now.get(Calendar.MINUTE);
int second = now.get(Calendar.SECOND);
int millis = now.get(Calendar.MILLISECOND);

System.out.printf("%d-%02d-%02d %02d:%02d:%02d.%03d", year, month + 1, day, hour, minute, second, millis);
Source by prograide.com #
 
PREVIOUS NEXT
Tagged: #datetime #anne #month #jour #heure #minute #java
ADD COMMENT
Topic
Name
4+6 =