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.2.1.12 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.11 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.10 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.9 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.8 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.7 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.6 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.5 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.4 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.3 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.2 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.1 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.1.0 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.0.6 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.0.5 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.0.4 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.0.3 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.0.2 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.0.1 tracks/scala/exercises/gigasecond/example.scala
trackler-2.2.0.0 tracks/scala/exercises/gigasecond/example.scala