Package

root package

Permalink

package root

Scala Time

scala-time is a simple Scala wrapper for easier use JDK 1.8.0 (Java 8) time APIs

Overview

The library is contained in the scalatime package which includes extension methods provided via implicit conversion methods to Scala value classes.

For usage examples see below:

Example:
  1. // Import the required classes path:
    import java.time._
    import 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
    // Obtain a LocalDate instance
    val localDate = LocalDate.of(2014, 6, 7)
    // Obtain a default TemporalQuery for the precision
    val query = temporal.TemporalQueries.precision
    // Obtain a Duration instance from a sum of Durations
    duration + otherDuration
    //  Add a TemporalAmount to a Temporal
    localDate + period
    //  Add a TemporalAmount to a Temporal
    period <<+ localDate
    // Subtract a TemporalAmount from a Temporal
    localDate - period
    // Query a specified Temporal
    val result = query |> localDate
Visibility
  1. Public
  2. All

Value Members

  1. package codes

    Permalink

Ungrouped