https://github.com/fortescarlet/kron
A multi-platform cron expression parser
https://github.com/fortescarlet/kron
cron kotlin kotlin-multiplatform
Last synced: 2 months ago
JSON representation
A multi-platform cron expression parser
- Host: GitHub
- URL: https://github.com/fortescarlet/kron
- Owner: ForteScarlet
- License: apache-2.0
- Created: 2021-08-06T17:31:15.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T08:35:27.000Z (over 3 years ago)
- Last Synced: 2025-02-11T14:25:16.781Z (4 months ago)
- Topics: cron, kotlin, kotlin-multiplatform
- Language: Kotlin
- Homepage:
- Size: 82 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kron
一个基于 `kotlin-multiplatform` 的 cron解析、生成工具。
*暂时不支持对 `星期(day of week)` 的解析,只支持通配符 `*`。*
```kotlin
val cron = resolveCron("1-3 0 0 1 * *")val executor = cron.executor()
var i = 1
for (instant in executor) {
println(instant.toLocalDateTime(TimeZone.currentSystemDefault()))
if (i++ >= 10) {
break
}
}
```