File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
AgeInMinutes/app/src/main/java/com/example/ageinminutes Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import android.widget.Button
77import android.widget.TextView
88import android.widget.Toast
99import androidx.appcompat.app.AppCompatActivity
10+ import java.text.SimpleDateFormat
1011import java.util.*
1112
1213class MainActivity : AppCompatActivity () {
@@ -40,7 +41,12 @@ class MainActivity : AppCompatActivity() {
4041
4142 // get the reference of the text view
4243 val showSelectedDate = findViewById<TextView >(R .id.tvSelectedDate)
43- showSelectedDate.setText(selectedDate).toString()
44+ // get the values form selected date
45+ showSelectedDate.setText(selectedDate)
46+ // converting the date into a standard format
47+ val formatDate = SimpleDateFormat (" dd/MM/yyyy" , Locale .ENGLISH )
48+ // storing the format date
49+ val theDate = formatDate.parse(selectedDate)
4450 },
4551 year,
4652 month,
You can’t perform that action at this time.
0 commit comments