Packages

  • package root

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

    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:

    Definition Classes
    root
    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
  • package codes
    Definition Classes
    root
  • package reactive
    Definition Classes
    codes
  • package scalatime

    Basic Scala wrapper for easier use of JSR-310 compatible time APIs.

    Basic Scala wrapper for easier use of JSR-310 compatible time APIs.

    Definition Classes
    reactive
  • package control

    Provides functionality relating to Exception handling, validation and control structures.

    Provides functionality relating to Exception handling, validation and control structures.

    Definition Classes
    scalatime
    See also

    control.Catcher

  • Catcher
  • package impl
    Definition Classes
    scalatime

package control

Provides functionality relating to Exception handling, validation and control structures.

Source
package.scala
See also

control.Catcher

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. control
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. object Catcher

    Provides methods for obtaining default Catchers for possible DateTimeExceptions thrown by the underlying Java API.

    Provides methods for obtaining default Catchers for possible DateTimeExceptions thrown by the underlying Java API.

    Example:
    1. import java.time._
      import codes.reactive.scalatime._
      import control.Catcher
      
       // Obtain a TimeCatcher for all DateTimeExceptions
       val catchAllLocalDate = Catcher.all(_ => LocalDate.now())
      
       // Use the catcher to recover from a parse error
       val recovered = Try { LocalDate.parse(")(&#)(@*@&#%@#%@#%)") } recover catchAllLocalDate

Inherited from AnyRef

Inherited from Any

Ungrouped