web123456

Java gets the current time accurately to milliseconds

new SimpleDateFormat("yyyyMMddHHmmssSSS") .format(new Date() );

Method 2:
Calendar Cld = ();

int YY = () ;
int MM = ()+1;
int DD = ();
int HH = (Calendar.HOUR_OF_DAY);
int mm = ();
int SS = ();
int MI = ();

String curTime = YY + MM + DD + HH + mm + SS + MI;

 

Calendar cal = ();
date = ();

SimpleDateFormat sdFormat = new SimpleDateFormat("yyyyMMddhhmmssSSS");

String myTime = (currentTime);