With Below code we can get date and time import java.text.SimpleDateFormat fun convertLongToTime (time: Long): String { From API level 26 on (Android) or if JVM is your target, we can use Java 8 Date API: val date = Instant val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm") Below API level 26: val date = Date(1595386325905) val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm")
import java.util.Date
val date = Date(time)
val format = SimpleDateFormat("dd/M/yyyy hh:mm:ss")
return format.format(date)
}
.ofEpochMilli(1164925597950)
.atZone(ZoneId.systemDefault()) // change time zone if necessary
.toLocalDateTime()
println(formatter.format(date))
println(formatter.format(date))
Fix Android Emulator Kill Error When Running Your App
How to start a new activity on button click
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
What is Context?
What is ANR? How to avoid and resolve it?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
Fix Play Store Rejection Due to SMS Permission - RRutors
How to convert milli seconds to hours, minutes and seconds in Android?
How to copy database from assets folder in android using kotlin
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
How To Set Text Color Programmatically Android TextView?
Permission denied for window type 2010 in Marshmallow device
How do i load image from drawable folder in Jetpack Compose?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to get a contact image using a phone number in android?
What is "shared preferences" in Android ?
Android Studio project R can't find
What is the difference between match_parent and fill_parent?
How to get screen size (width,height) in Android?
What is NetworkOnMainThread Exception?
Check List for Generate Signed APK Android
What happens next when the device switches between portrait and landscape?
Set Activity to Fullscreen Mode in Android - RRutors
Invoke-customs are only supported starting with android 0 --min-api 26
Key Points to remember while develop the Android Application.
How to Get bitmap from drawable: Android
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
How to Generate signed apk with android studio
How to save activity State in Android?
Decompile APK Files: How to Get Source Code - RRutors Guide
How can i comment inside xml file in android studio?
Open PDF in Google Drive with Intent in Android - RRutors
What is Application?
How to install/ uninstall apk by command line ADB
What is Android Fragments?
What is Android?
How do I check in SQLite whether a table exists?
FCM Not Receiving Notifications in Android - RRutors
How to Use Deprecated Handler() in Android - RRutors Guide
How to check Android version?