Sha256: 97d437be4d0dbf4a500ec486297971a626f1154184fb24f084685e3677b8ee5b

Contents?: true

Size: 455 Bytes

Versions: 166

Compression:

Stored size: 455 Bytes

Contents

import java.time.LocalDate
import java.time.LocalDateTime
import java.time.LocalTime

object Gigasecond {
  private type Seconds = Long

  def add(startDate: LocalDate): LocalDateTime = {
    val startDateTime = LocalDateTime.of(startDate, LocalTime.of(0, 0))
    add(startDateTime)
  }

  def add(startDateTime: LocalDateTime): LocalDateTime =
    startDateTime.plusSeconds(OneGigasecond)

  private val OneGigasecond: Seconds = math.pow(10, 9) toLong
}

Version data entries

166 entries across 166 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.97 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.96 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.95 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.94 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.93 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.92 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.91 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.90 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.89 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.88 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.87 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.86 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.85 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.84 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.83 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.82 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.81 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.80 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.79 tracks/scala/exercises/gigasecond/example.scala