Scala Time

Basic Scala wrapper for convenient use of JDK 1.8.0 time libraries.

License

License

Categories

Categories

Scala Languages React User Interface Web Frameworks
GroupId

GroupId

codes.reactive
ArtifactId

ArtifactId

scala-time_2.11
Last Version

Last Version

0.4.2
Release Date

Release Date

Type

Type

jar
Description

Description

Scala Time
Basic Scala wrapper for convenient use of JDK 1.8.0 time libraries.
Project Organization

Project Organization

codes.reactive
Source Code Management

Source Code Management

https://github.com/reactivecodes/scala-time

Download scala-time_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/codes.reactive/scala-time_2.11/ -->
<dependency>
    <groupId>codes.reactive</groupId>
    <artifactId>scala-time_2.11</artifactId>
    <version>0.4.2</version>
</dependency>
// https://jarcasting.com/artifacts/codes.reactive/scala-time_2.11/
implementation 'codes.reactive:scala-time_2.11:0.4.2'
// https://jarcasting.com/artifacts/codes.reactive/scala-time_2.11/
implementation ("codes.reactive:scala-time_2.11:0.4.2")
'codes.reactive:scala-time_2.11:jar:0.4.2'
<dependency org="codes.reactive" name="scala-time_2.11" rev="0.4.2">
  <artifact name="scala-time_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='codes.reactive', module='scala-time_2.11', version='0.4.2')
)
libraryDependencies += "codes.reactive" % "scala-time_2.11" % "0.4.2"
[codes.reactive/scala-time_2.11 "0.4.2"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.11 jar [3.0,3.1)

Project Modules

There are no modules declared in this project.

scala-time

Basic Scala utilities allowing for easier use of java.time APIs.

Note: Support has now been dropped for JDK 7 and the Threeten BP backport APIs.

Supported Scala Versions:
  • 2.13
  • 2.12
  • 2.11
  • 2.10


Usage:

This project is not yet considered stable, and the API is subject to change, however version 0.4.2 binaries are published to the Maven Central public repository.

sbt coordinates:
    // Requires JDK 1.8 and above
    "codes.reactive" %% "scala-time" % "0.4.2"

Documentation:

See the project website for links to current documentation.

Examples:

import java.time._
import scalatime._  // NOTE: Package name was changed from codes.reactive.scalatime => scalatime 
                    // for versions 0.5.x and newer. If still using 0.4.x, use codes.reactive.scalatime

// Obtain a Duration instance from a Long
val duration = 10L minutes

val otherDuration = 1L minute

// Obtain a Period instance from an Int
val period = 2 weeks

// Obtains a LocalDate instance
val localDate = LocalDate.of(2014, 6, 7)

// Obtain a default TemporalQuery for precision
val query = temporal.TemporalQueries.precision

// Obtain a Duration instance from a sum of Durations
duration + otherDuration

//  Add a TemporalAmount to a Temporal
period <<+ localDate

//  Add a TemporalAmount to a Temporal
localDate + period

// Subtract a TemporalAmount from a Temporal
localDate - period

// Query a specified Temporal
val result = query |> localDate

License

See the NOTICE file distributed with this work for additional information regarding copyright ownership

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Versions

Version
0.4.2
0.4.1
0.4.0
0.1.0-RC1