All Downloads are FREE. Search and download functionalities are using the official Maven repository.

izumi.fundamentals.platform.time.IzDate.scala Maven / Gradle / Ivy

The newest version!
package izumi.fundamentals.platform.time

import java.time.OffsetDateTime
import java.util.Date

import izumi.fundamentals.platform.time.IzTime.TZ_UTC

final class IzDate(private val value: Date) extends AnyVal {
  def toTsAsUtc: OffsetDateTime = value.toInstant.atZone(TZ_UTC).toOffsetDateTime

  def <=(other: Date): Boolean = {
    value.equals(other) || value.before(other)
  }

  def >=(other: Date): Boolean = {
    value.equals(other) || value.before(other)
  }

  def <(other: Date): Boolean = {
    value.before(other)
  }

  def >(other: Date): Boolean = {
    value.after(other)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy