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.180 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.179 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.178 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.177 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.176 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.175 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.174 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.173 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.172 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.171 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.170 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.169 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.167 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.166 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.165 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.164 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.163 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.162 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.161 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.160 tracks/scala/exercises/gigasecond/example.scala