Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bpholt/java-time-literals
Scala string interpolaters for parsing string literals into `java.time` instances at compile time
https://github.com/bpholt/java-time-literals
hacktoberfest scala
Last synced: 9 days ago
JSON representation
Scala string interpolaters for parsing string literals into `java.time` instances at compile time
- Host: GitHub
- URL: https://github.com/bpholt/java-time-literals
- Owner: bpholt
- License: mit
- Created: 2021-03-10T23:45:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-26T20:01:35.000Z (about 1 month ago)
- Last Synced: 2024-10-20T15:42:10.530Z (17 days ago)
- Topics: hacktoberfest, scala
- Language: Scala
- Homepage:
- Size: 153 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# `java.time` Literals
Parse Scala string literals into `java.time` instances at compile time.
```scala
> import dev.holt.javatime.literals._
> duration"PT20.345S"
val res0: java.time.Duration = PT20.345S
```See the [test suite for comprehensive examples](https://github.com/bpholt/java-time-literals/blob/main/core/shared/src/test/scala/dev/holt/javatime/JavaTimeSuite.scala)
of all supported literal types.## Scala.js and Scala Native
Since Scala.js and Scala Native don't have a built-in timezone database, if you need to use
timezones other than UTC on those platforms, make sure to include```scala
"io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.5.0"
```in your project dependencies.