Answered by : santosh-pal
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String strDate = sdf.format(c.getTime());
Log.d("Date","DATE : " + strDate)
Source : | Last Update : Fri, 05 Mar 21
Answered by : santosh-pal
String currentDateTimeString = java.text.DateFormat.getDateTimeInstance().format(new Date());
// textView is the TextView view that should display it
textView.setText(currentDateTimeString);
Source : | Last Update : Fri, 05 Mar 21
Answered by : dead-dugong-c7rzxvpxshxr
import java.util.Calendar;
import java.util.Date;
Date currentTime = Calendar.getInstance().getTime();
Source : https://stackoverflow.com/questions/5369682/how-to-get-current-time-and-date-in-android | Last Update : Mon, 24 Oct 22
Answered by : santosh-pal
SimpleDateFormat sdf = new SimpleDateFormat("ddMMyyyy_HHmmss", Locale.getDefault()); String currentDateandTime = sdf.format(new Date()); System.out.println("currentDateandTime" + currentDateandTime);
Source : | Last Update : Fri, 05 Mar 21
Answered by : santosh-pal
import java.util.Calendar
Date currentTime = Calendar.getInstance().getTime();
Source : | Last Update : Mon, 08 Mar 21
Answered by : xenophobic-xenomorph-ie743k9xg06p
SimpleDateFormat.getDateInstance().format(Date())
Source : https://stackoverflow.com/questions/8654990/how-can-i-get-current-date-in-android/15698784 | Last Update : Wed, 24 Jun 20
Answered by : xenophobic-xenomorph-ie743k9xg06p
SimpleDateFormat.getTimeInstance().format(Date())
Source : https://stackoverflow.com/questions/8654990/how-can-i-get-current-date-in-android/15698784 | Last Update : Wed, 24 Jun 20
Answered by : xenophobic-xenomorph-ie743k9xg06p
String dateStr = "04/05/2010";
SimpleDateFormat curFormater = new SimpleDateFormat("dd/MM/yyyy");
Date dateObj = curFormater.parse(dateStr);
SimpleDateFormat postFormater = new SimpleDateFormat("MMMM dd, yyyy");
String newDateStr = postFormater.format(dateObj);
Source : https://stackoverflow.com/questions/8654990/how-can-i-get-current-date-in-android/15698784 | Last Update : Wed, 24 Jun 20