how to get current date time in android

‮al.www‬utturi.com
how to get current date time in android
SimpleDateFormat sdf = new SimpleDateFormat("ddMMyyyy_HHmmss", Locale.getDefault());
String currentDateandTime = sdf.format(new Date());
System.out.println("currentDateandTime" + currentDateandTime);
Created Time:2017-09-15 21:33:34  Author:lautturi