get current date and time in java android code example
Example 1: android studio get time
String currentTime = new SimpleDateFormat("HH:mm:ss", Locale.getDefault()).format(new Date());
Example 2: code to get date and time in android
SimpleDateFormat.getDateInstance().format(Date())