kevin.cianfarini
01/17/2023, 4:42 PMLocalDateTime
to javas datetime utilities, how would I format the full date and time? Right now the value
LocalDateTime(
year = 2023,
monthNumber = 1,
dayOfMonth = 17,
hour = 10,
minute = 30
)
Gets formatted to Tuesday, January 17, 2023
with the following invocation:
DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
.withLocale(javaLocale)
.format(dateTime.toJavaLocalDateTime())
I would expect this to format to something like Tuesday, January 17, 2023 10:30 AM
.kevin.cianfarini
01/17/2023, 4:43 PMkevin.cianfarini
01/17/2023, 4:45 PMhfhbd
01/17/2023, 4:45 PMtoJavaLocalDateTime()
kevin.cianfarini
01/17/2023, 4:45 PMLocalDate
and LocalTime
.kevin.cianfarini
01/17/2023, 4:45 PMDateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)
.withLocale(javaLocale)
.format(dateTime.toJavaLocalDateTime())
kevin.cianfarini
01/17/2023, 4:48 PMDateTimeFormatter.ofLocalizedDateTime
. That’s probably what I need.kevin.cianfarini
01/17/2023, 4:53 PMDateTimeFormatter.ofLocalizedDateTime(
FormatStyle.FULL,
FormatStyle.SHORT
).withLocale(javaLocale).format(dateTime.toJavaLocalDateTime())
which yields
Tuesday, January 17, 2023, 10:30 AM
kevin.cianfarini
01/17/2023, 4:53 PMFULL
format style on kotlinx.LocalDateTime
for the time component because local date times don’t have timezone info embedded.