I am trying to get today\'s Year, Month and Date using following code;
Calendar calendar = Calendar.getInstance(); int thisYear = calendar.get(Calendar.YEAR); L
You can use SimpleDateFormat
Initialising as @SuppressLint("SimpleDateFormat") final SimpleDateFormat dateAndTime = new SimpleDateFormat("DD-MM-yy", Locale.getDefault());
@SuppressLint("SimpleDateFormat") final SimpleDateFormat dateAndTime = new SimpleDateFormat("DD-MM-yy", Locale.getDefault());
and String timeStamp = dateAndTime.format(new Date());
String timeStamp = dateAndTime.format(new Date());