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))
What is Intent? What is the difference between an implicit intent and an explicit intent?
How To Set Text Color Programmatically Android TextView?
How to Generate signed apk with android studio
Could not inflate Behavior subclass android.support.design.widget. BottomSheetBehavior How resolve
Is There A Way To Get The Source Code From An APK File? (or) How to decompile apk?
How to convert milli seconds to hours, minutes and seconds in Android?
ERR_ACCESS_DENIED in Android Webview with sdk 30
How do I generate random numbers in Dart?
'constructor Handler()' is deprecated. Deprecated in Java, How to use Handler() class in And
How to Get bitmap from drawable: Android
How to check Android version?
How to validate email address in Android with Kotlin?
What is Application?
How to get screen size (width,height) in Android?
How to Exit android app on back pressed?
What is Android?
Key Points to remember while develop the Android Application.
How to convert DP to Pixel and Pixel to Dp?
How to find Android Device UDID or unique ID?
What is "shared preferences" in Android ?
Permission denied for window type 2010 in Marshmallow device
What is NetworkOnMainThread Exception?
How do I check in SQLite whether a table exists?
How do i load image from drawable folder in Jetpack Compose?
What is ANR? How to avoid and resolve it?
Explain Fragment Life Cycle
What are the notifications available in android?
How to extract date and time from Long type variable in Kotlin on Android "
How to reduce APK package size?
ERROR Android emulator gets killed when I try to run my application and choose an emulator it ret
What is the Different Between val and var in Kotlin?
How to add jar/library files as a dependency in Android studio gradle file
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
How to start a new activity on button click
How to save activity State in Android?
How to get complete address from latitude and longitude?
Android Studio project R can't find
Invoke-customs are only supported starting with android 0 --min-api 26
Android Activity FullScreen - How to set activity to fullscreen mode in Android?
Check List for Generate Signed APK Android