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 : paul-smith-h1kxhourr6fx
import java.time.*;
LocalDate date = LocalDate.now();
Source : | Last Update : Fri, 12 Feb 21
Answered by : blushing-buzzard-95xmfn93jfvs
String date = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(new Date());
Source : https://stackoverflow.com/questions/8654990/how-can-i-get-current-date-in-android/15698784 | Last Update : Mon, 21 Sep 20
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 : paul-smith-h1kxhourr6fx
import java.time.*;
LocalTime time = LocalTime.now();
Source : | Last Update : Fri, 12 Feb 21
Answered by : paul-smith-h1kxhourr6fx
import java.time.*;
LocalDateTime datetime = LocalDateTime.now();
Source : | Last Update : Fri, 12 Feb 21
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 : belaid-nacereddine
import java.util.Calendar Date currentTime = Calendar.getInstance().getTime();
Source : https://androidandrey.com/ | Last Update : Thu, 18 Aug 22
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