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 Play Store Rejection Due to SMS Permission - RRutors
How do i load image from drawable folder in Jetpack Compose?
How do I generate random numbers in Dart?
How to convert DP to Pixel and Pixel to Dp?
Key Points to remember while develop the Android Application.
What is ANR in android?
What are the notifications available in android?
Invoke-customs are only supported starting with android 0 --min-api 26
Permission denied for window type 2010 in Marshmallow device
What is Android?
How to Generate signed apk with android studio
FCM Not Receiving Notifications in Android - RRutors
Check List for Generate Signed APK Android
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to convert milli seconds to hours, minutes and seconds in Android?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How to check Android version?
How to stop EditText focus at Activity startup in Android?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
ERR_ACCESS_DENIED in Android Webview with sdk 30
How to copy database from assets folder in android using kotlin
How to validate email address in Android with Kotlin?
How do I check in SQLite whether a table exists?
What is the Different Between val and var in Kotlin?
How can i comment inside xml file in android studio?
What is "shared preferences" in Android ?
How to Get bitmap from drawable: Android
Android Studio project R can't find
How To Set Text Color Programmatically Android TextView?
What is the difference between match_parent and fill_parent?
How to get a contact image using a phone number in android?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
How to get screen size (width,height) in Android?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
Fix Duplicate Files in APK Build.gradle Issue - RRutors
How to install/ uninstall apk by command line ADB
What is Application?
How to avoid multiple button click at same time in android?
Decompile APK Files: How to Get Source Code - RRutors Guide
Hide/Disable soft keyboard on Activity launch: Android