How to get current local date and time in Kotlin?
# android
r
How to get current local date and time in Kotlin?
google 2
o
But still, pretty please be specific to what problem you’re having.
Presented like this it won’t have a good answer.
a
Also a simple Google search ...
v
val current = LocalDateTime.now()
for format of date and time use this code
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HHmmss.SSS") val formatted = current.format(formatter)
g
If you’re asking for kotlin libraries for dealing with time, there are https://github.com/debop/koda-time, https://github.com/soywiz/klock and a more recent https://github.com/kizitonwose/Time