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.0.8.50 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.49 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.48 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.47 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.46 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.45 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.44 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.43 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.42 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.41 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.40 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.39 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.38 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.37 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.36 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.35 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.34 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.33 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.32 tracks/scala/exercises/gigasecond/example.scala
trackler-2.0.8.31 tracks/scala/exercises/gigasecond/example.scala