LocalDateExtension #1
fabian3117
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi 😄
In the file LocalDateExtensions.kt ( Package extensions ) using this code :
fun LocalDate.Companion.now(): LocalDate { val currentInstant = Clock.System.now() val timeZone = TimeZone.currentSystemDefault() return currentInstant.toLocalDateTime(timeZone).date }But if in devices android with the setting in Time zone automatic using red this produce error , in example my case.
I have device samsung in argentina ( LATAM ) with setting Time Zone automatic and don't found gets timeZone correct.
Can using one parameter in compouse TimeZone : String to setting this parameter with parameter default TimeZone.currentSystemDefault() .
Beta Was this translation helpful? Give feedback.
All reactions