kotlinx-datetime icon indicating copy to clipboard operation
kotlinx-datetime copied to clipboard

DateTimeFormatter

Open kartik-prakash opened this issue 2 years ago • 1 comments

Hi all,

I'm working on adding support for DateTimeFormatter, it seems pretty straight forward for JVM and JS platforms and I'll open a PR soon for these two platforms. However, I haven't done much native stuff and was wondering if anyone have any ideas or thoughts for native implementation.

I noticed currently all of the native code is implemented around ISO_OFFSET_DATE_TIME format, any ideas or thoughts on how to extend it to support other formats?

kartik-prakash avatar Jul 20 '21 03:07 kartik-prakash

Hello @kprakash-dev ,

I'm also creating a DateTimeFormatter (+ZonedDateTime) on my own

You can take a look for the implementation of Apple targets.

ISO_OFFSET_DATE_TIME can be easily translated as string pattern such as "YYYY-MM-dd'T'HH:mm:ssXXXX" (source: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ISO_OFFSET_DATE_TIME)

Louis

GautierLouis avatar Dec 31 '21 15:12 GautierLouis