On Fri, Mar 10, 2023 at 11:28 AM Igor Wojda <[email protected]> wrote:
>
> Hi
>
> How can I parse LoaclDateTime to ISO 8601 format?

I think your question is actually "how do I WRITE (serialize)
LocalDateTime as JSON String using ISO-8601 format".
Parsing would mean reading JSON String into LocalDateTime, which
probably works fine.
Now, by default date/time values are written as timestamps (numbers);
you need to configure handling like so:

>
> Scenario:
> val data class task(val name: String, val loaclDateTime: LoaclDateTime)
>
> val objectMapper = ObjectMapper()

    objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);

and then output should contain ISO-8601 formatted JSON String instead of number.

Hope this helps,

-+ Tatu +-

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/CAGrxA24%2BJVGe0%2B0HmjzwPPNP8zWaNUV3RdW-G27hU48%2BYWK4QA%40mail.gmail.com.

Reply via email to