root package

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 which includes type aliases, as well as factory objects for core java.time types and constant values.

It is further divided into packages corresponding to the underlying java.time package - with the exception of the syntax package which includes additional implicit conversion functions as well as methods for easier use of the underlying java types; and the control package which provides default scala.util.control.Exception.Catcher instances for exceptions which may be thrown by the underlying library, and type aliases for those exceptions.

Package Structure
Example:
  1. // Import the required classes path:
    import codes.reactive.scalatime._
    import syntax._
    
    // Obtain a Duration instance from a Long
    val duration = 10L minutes
    
    val otherDuration = 1L minute
    
    // Tries to obtain a Period instance from an Int
    val period = 2 weeks
    
    // Obtain a LocalDate instance
    val localDate = LocalDate.of(2014, 6, 7)
    
    // Obtain the current UTC ZonedDateTime
    val zonedDateTime = ZonedDateTime()
    
    // Obtain a default TemporalQuery for the ZoneId
    val query = temporal.TemporalQuery.zone
    
    // Obtain a Duration instance from a sum of Durations
    duration + otherDuration
    
    //  Add a TemporalAmount to a Temporal
    localDate.get + period
    
    //  Add a TemporalAmount to a Temporal
    period <<+ localDate.get
    
    // Subtract a TemporalAmount from a Temporal
    localDate.get - period
    
    // Query a specified Temporal
    val result = query << zonedDateTime
Visibility
  1. Public
  2. All

Value Members

  1. package codes

Ungrouped