Sha256: 80f46e7f22c76039b6b75f366925a161085dceb142724acfc1c9550be0d32548

Contents?: true

Size: 488 Bytes

Versions: 172

Compression:

Stored size: 488 Bytes

Contents

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

object Gigasecond {
  private type Seconds = Long

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

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

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

Version data entries

172 entries across 172 versions & 1 rubygems

Version Path
trackler-2.1.0.14 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.13 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.12 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.11 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.10 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.9 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.8 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.7 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.6 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.5 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.4 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.3 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.2 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.1 tracks/scala/exercises/gigasecond/example.scala
trackler-2.1.0.0 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.55 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.54 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.53 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.52 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.51 tracks/scala/exercises/gigasecond/example.scala