I want to convert current time to following format "2008-01-12 11:46:55.945000". I tried but I an not able to do. Could you pelase hlep me out or is there any easy way to do
Calendar calendar = Calendar.getInstance();
//2008-01-12 11:46:55.945000
int year = calendar.get(Calendar.YEAR);
int date = calendar.get(Calendar.DATE);
int month = calendar.get(Calendar.MONTH);
int hour = calendar.get(Calendar.HOUR);
int minite = calendar.get(Calendar.MINUTE);
int second = calendar.get(Calendar.SECOND);
int millisecond = calendar.get(Calendar.MILLISECOND);
String timestamp = year+"-"+date+"-"+month+" "+hour+":"+minite+":"+second+"."+millisecond;