All Projects → korlibs → Klock

korlibs / Klock

Licence: cc0-1.0
Multiplatform Date and time library for Kotlin

Programming Languages

javascript
184084 projects - #8 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Klock

Md Date Time Picker
An implementation of Material Design Picker components in vanilla CSS, JS, and HTML
Stars: ✭ 272 (-52.2%)
Mutual labels:  time, date, clock
Timestamp
⏰ A better macOS menu bar clock.
Stars: ✭ 296 (-47.98%)
Mutual labels:  time, date, clock
Mvikotlin
Extendable MVI framework for Kotlin Multiplatform with powerful debugging tools (logging and time travel)
Stars: ✭ 483 (-15.11%)
Mutual labels:  multiplatform, jvm, native
ElevenClock
ElevenClock: Customize Windows 11 taskbar clock
Stars: ✭ 1,494 (+162.57%)
Mutual labels:  time, date, clock
Awesome Falsehood
😱 Falsehoods Programmers Believe in
Stars: ✭ 16,614 (+2819.86%)
Mutual labels:  time, date
react-ago-component
A component for React that renders the approximate time ago in words from a specific past date using an HTML5 time element.
Stars: ✭ 25 (-95.61%)
Mutual labels:  time, date
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (-5.8%)
Mutual labels:  time, date
Maya
Datetimes for Humans™
Stars: ✭ 3,298 (+479.61%)
Mutual labels:  time, date
Time
Simple time handling in Rust
Stars: ✭ 334 (-41.3%)
Mutual labels:  time, date
Zircon
Zircon is an extensible and user-friendly, multiplatform tile engine.
Stars: ✭ 552 (-2.99%)
Mutual labels:  multiplatform, jvm
Portable Snippets
Collection of miscellaneous portable C snippets.
Stars: ✭ 397 (-30.23%)
Mutual labels:  time, clock
edtf.js
Extended Date Time Format (ISO 8601-2 / EDTF) Parser for JavaScript
Stars: ✭ 44 (-92.27%)
Mutual labels:  time, date
Date Fns Tz
Complementary library for date-fns v2 adding IANA time zone support
Stars: ✭ 385 (-32.34%)
Mutual labels:  time, date
Knptimebundle
Provides helpers for time manipulation
Stars: ✭ 459 (-19.33%)
Mutual labels:  time, date
React Datetime Picker
A datetime picker for your React app.
Stars: ✭ 294 (-48.33%)
Mutual labels:  time, date
date-php
这是一个Javascript模仿PHP日期时间格式化函数,使用方法和PHP非常类似,有丰富的模板字符,并在原来的基础上增加了一些模板字符。 This is a date function that implement PHP in Javascript. It is very similar to PHP, has rich template characters, and enhances some template characters on the basis of the original.
Stars: ✭ 24 (-95.78%)
Mutual labels:  time, date
clock
High-resolution clock functions: monotonic, realtime, cputime.
Stars: ✭ 52 (-90.86%)
Mutual labels:  time, clock
dayjs
Extended fork of Day.js - 2KB immutable date library alternative to Moment.js
Stars: ✭ 36 (-93.67%)
Mutual labels:  time, date
date4j
Lightweight alternative to Java's built-in date-time classes. Android-friendly. Compiles under JDK 1.5.
Stars: ✭ 36 (-93.67%)
Mutual labels:  time, date
Human Interval
Human readable time distances for javascript
Stars: ✭ 360 (-36.73%)
Mutual labels:  time, date

Klock

Klock is a Date & Time library for Multiplatform Kotlin 1.3.

It is designed to be as allocation-free as possible using Kotlin inline classes, to be consistent and portable across targets since all the code is written in Common Kotlin, and to provide an API that is powerful, fun and easy to use.

Build Status Maven Version Discord

Support klock

If you like klock, or want your company logo here, please consider becoming a sponsor ★,
in addition to ensure the continuity of the project, you will get exclusive content.

Full Documentation: https://korlibs.soywiz.com/klock/

Some samples:

val now = DateTime.now()
val duration = 1.seconds
val later = now + 1.months + duration
val is2018Leap = Year(2018).isLeap
val daysInCurrentMonth = now.yearMonth.days
val daysInNextMonth = (now.yearMonth + 1.months).days

Usage with gradle:

(Compiled and tested with Gradle 5.4.1, JVM 12.0.1 and Kotlin 1.3.31). Starting with Klock 1.4.0, the library is available at jcenter.

def klockVersion = "1.7.3"

repositories {
    jcenter()
}

kotlin {
    sourceSets {
        commonMain {
            dependencies {
                implementation "com.soywiz.korlibs.klock:klock:$klockVersion" // Common 
            }
        }
    }
}

settings.gradle

enableFeaturePreview('GRADLE_METADATA')

Use with Kotlin-JVM

def klockVersion = "1.7.3"

repositories {
    jcenter()
}

dependencies {
    implementation "com.soywiz.korlibs.klock:klock-jvm:$klockVersion"
}

Versions

Klock Kotlin Gradle Metadata JVM version
2.0.0-alpha 1.4.10 1.0 1.8
1.12.0 1.4.0 1.0 1.8
1.11.14 1.3.72 1.0 1.8
1.8.4 1.3.61 1.0 1.8
1.8.0 1.3.60 1.0 1.8
1.7.0 1.3.50 1.0 1.6
1.6.0 1.3.50 1.0 1.6
1.5.0 1.3.40 1.0 1.6
1.4.0 1.3.21 1.0 1.6

Testing & Kotest

Kotest is a flexible and comprehensive testing tool for Kotlin with multiplatform support. It supports Klock adding additional matchers. For a full list of Klock Kotest matchers, check this link: https://github.com/kotest/kotest/blob/master/doc/matchers.md

And you can find a sample here: https://github.com/kotest/kotest/tree/master/kotest-assertions/kotest-assertions-klock

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].