kotlinx-datetime | KotlinX multiplatform date/time library

 by   Kotlin Kotlin Version: 0.4.1 License: Apache-2.0

kandi X-RAY | kotlinx-datetime Summary

kandi X-RAY | kotlinx-datetime Summary

kotlinx-datetime is a Kotlin library. kotlinx-datetime has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

There are a few guiding principles in the design of kotlinx-datetime. First of all, it is pragmatic, focused on the most common problems developers face every day (pun intended) when working with dates and times. It is not all-encompassing and lacks some domain-specific utilities that special-purpose applications might need. We chose convenience over generality, so the API surface this library provides is as minimal as possible to meet the use-cases. The library puts a clear boundary between physical time of an instant and a local, time-zone dependent civil time, consisting of components such as year, month, etc that people use when talking about time. We intentionally avoid entities in the library that mix both together and could be misused. However, there are convenience operations that take, for example, a physical instant and perform a calendar-based adjustment (such as adding a month); all such operation explicitly take a time-zone information as parameter to clearly state that their result depends on the civil time-zone rules which are subject to change at any time. The library is based on the ISO 8601 international standard, other ways to represent dates and times are out of its scope. Internationalization (such as locale-specific month and day names) is out the scope, too.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              kotlinx-datetime has a medium active ecosystem.
              It has 1728 star(s) with 74 fork(s). There are 68 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 44 open issues and 111 have been closed. On average issues are closed in 110 days. There are 12 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of kotlinx-datetime is 0.4.1

            kandi-Quality Quality

              kotlinx-datetime has 0 bugs and 0 code smells.

            kandi-Security Security

              kotlinx-datetime has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              kotlinx-datetime code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              kotlinx-datetime is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              kotlinx-datetime releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              It has 8594 lines of code, 646 functions and 83 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of kotlinx-datetime
            Get all kandi verified functions for this library.

            kotlinx-datetime Key Features

            No Key Features are available at this moment for kotlinx-datetime.

            kotlinx-datetime Examples and Code Snippets

            No Code Snippets are available at this moment for kotlinx-datetime.

            Community Discussions

            QUESTION

            How can you format a kotlinx-datetime LocalDateTime?
            Asked 2021-Nov-06 at 13:41

            I'm converting some code from using Java 8's LocalDatetime to using the version from kotlinx-datetime and I can't find any formatting methods. Specifically, I'm replacing a FormatStyle.MEDIUM. Do they not exist and I need to write the formatting?

            This is for an Android app. Is there are there Android specific libraries I can use? Or can I do this with pre-Java 8 methods to maintain support for older versions of Android?

            Edit (my solution based on the answer from Arvind):

            ...

            ANSWER

            Answered 2021-Nov-06 at 12:20

            As per the documentation, in a JVM, the implementation of date/time types, such as Instant, LocalDateTime, TimeZone and so on, relies on java.time API. It also natively supports ThreeTen backport project using which you can backport most of the java.time functionality to Java 6 & 7. Check How to use ThreeTenABP in Android Project to learn how to set it up.

            In case you want to replace an OOTB (Out-Of-The-Box) format e.g FormatStyle.MEDIUM, you can always define a custom format using DateTimeFormatter e.g.

            Source https://stackoverflow.com/questions/69854471

            QUESTION

            building kotlinJs app on github actions CI
            Asked 2021-Jun-08 at 08:57

            I'm having some issues setting up github actions to build my kotlinJS project? i have the js runtime dependency:

            ...

            ANSWER

            Answered 2021-Jun-08 at 08:57

            looks like this was due to an older version of kotlin-serialization dependency in kotlin-datetime updating to kotlin-datetime 0.2.1 fixed it

            Source https://stackoverflow.com/questions/67800532

            QUESTION

            How to configure Kotlin jvmTarget in a Multiplatform Android module?
            Asked 2021-Apr-09 at 16:31

            I'm getting this build error:

            Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option Adding support for Java 8 language features could solve this issue.

            Trying to compile this build script for a multiplatform module in Android Studio:

            ...

            ANSWER

            Answered 2021-Apr-09 at 16:31

            As per the documentation: https://kotlinlang.org/docs/mpp-dsl-reference.html#compilation-parameters

            Don't be fooled by the Gradle docs' code examples into thinking a lot of this compilation syntax applies only to the Java block. This is how you specify the jvm version target for an Android build:

            Source https://stackoverflow.com/questions/67009242

            QUESTION

            issue in including kotlinx-data-time libray in kotlinjs project
            Asked 2020-Aug-14 at 15:34

            FAILURE: Build failed with an exception.

            • What went wrong: Could not determine the dependencies of task ':packageJson'.

            Could not resolve all dependencies for configuration ':npm'. Could not resolve org.jetbrains.kotlinx:kotlinx-datetime:0.1.0. Required by: project : > Cannot choose between the following variants of org.jetbrains.kotlinx:kotlinx-datetime:0.1.0: - jsIr-runtime - jsLegacy-runtime All of them match the consumer attributes: - Variant 'jsIr-runtime' capability org.jetbrains.kotlinx:kotlinx-datetime:0.1.0: - Unmatched attributes: - Found org.gradle.status 'release' but wasn't required. - Found org.jetbrains.kotlin.js.compiler 'ir' but wasn't required. - Compatible attributes: - Required org.gradle.usage 'kotlin-runtime' and found compatible value 'kotlin-runtime'. - Required org.jetbrains.kotlin.platform.type 'js' and found compatible value 'js'. - Variant 'jsLegacy-runtime' capability org.jetbrains.kotlinx:kotlinx-datetime:0.1.0: - Unmatched attributes: - Found org.gradle.status 'release' but wasn't required. - Found org.jetbrains.kotlin.js.compiler 'legacy' but wasn't required. - Compatible attributes: - Required org.gradle.usage 'kotlin-runtime' and found compatible value 'kotlin-runtime'. - Required org.jetbrains.kotlin.platform.type 'js' and found compatible value 'js'.

            • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

            • Get more help at https://help.gradle.org

            BUILD FAILED in 7s

            Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no]

            ...

            ANSWER

            Answered 2020-Aug-14 at 15:34

            When building a project using Kotlin 1.3.xx, you may encounter a Gradle error if one of your dependencies (or any transitive dependency) was built using Kotlin 1.4+:

            This resolution problem appears because Kotlin 1.4 introduces the choice between two different compiler backends for Kotlin/JS – a choice that was not available in Kotlin 1.3.xx.

            Workaround:

            In order to use the libraries, create a file called workaround_to_use_1_4_libs_in_1_3.gradle.kts in the root directory of your project, and add the following code:

            Source https://stackoverflow.com/questions/63415127

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install kotlinx-datetime

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/Kotlin/kotlinx-datetime.git

          • CLI

            gh repo clone Kotlin/kotlinx-datetime

          • sshUrl

            git@github.com:Kotlin/kotlinx-datetime.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link