To know the current date and time
- create a variable to store the format of date and time
val simpleDateFormat= SimpleDateFormat("dd-MM-yyyy HH:MM:SS")
2.After that we have to call the Date function, who can provide us date and time in a variable
val currentDT: String = simpleDateFormat.format(Date())
3. Last use Variable currentDT where you want
I hope it will use full
Thank you :)