Time

Source
__.scala

Member

opaque type DayTime

DayTime is an opaque Long value holding nanoseconds since midnigth

Time within Day

DayTime is an opaque Long value holding nanoseconds since midnigth

Source
DayTime.scala
opaque type DayTime

DayTime is an opaque Long value holding nanoseconds since midnigth

Time within Day

DayTime is an opaque Long value holding nanoseconds since midnigth

Source
DayTime.scala
opaque type Gmt

Time.Gmt is an opaque Long value same as Time, but not localized for printing

Greenwich Mean Time

Time.Gmt is an opaque Long value same as Time, but not localized for printing

  val time = Time()
  val gmt  = Time.Gmt()

  time.dayTime.toBrief.tp // Prints: 13:34

  gmt.dayTime.toBrief.tp  // Prints: 17:34

  // Nevertheless they are data equal

  (time.real == gmt.real).tp       // Prints: true
Source
Gmt.scala
opaque type Gmt

Time.Gmt is an opaque Long value same as Time, but not localized for printing

Greenwich Mean Time

Time.Gmt is an opaque Long value same as Time, but not localized for printing

  val time = Time()
  val gmt  = Time.Gmt()

  time.dayTime.toBrief.tp // Prints: 13:34

  gmt.dayTime.toBrief.tp  // Prints: 17:34

  // Nevertheless they are data equal

  (time.real == gmt.real).tp       // Prints: true
Source
Gmt.scala
opaque type Instant

Time.Instant is an opaque Long value, holding nanoseconds since start of 1970

Time.Instant is an opaque Long value, holding nanoseconds since start of 1970

General timing in scalqa is done with millisecond precision and it is sufficient for most scenarios.

Occasionally, however, nanosecond precision is required, and Time.Instant fills the gap:

    val t : Time    = CURRRENT
    val i : Instant = CURRRENT

    t.tp   // Printed: 2021-01-21 09:36:31.761

    i.tp   // Printed: 2021-01-21 09:36:31.766.000.000

Note. Time.Instant is limited to range of years from 1677 to 2260

Source
Instant.scala
opaque type Instant

Time.Instant is an opaque Long value, holding nanoseconds since start of 1970

Time.Instant is an opaque Long value, holding nanoseconds since start of 1970

General timing in scalqa is done with millisecond precision and it is sufficient for most scenarios.

Occasionally, however, nanosecond precision is required, and Time.Instant fills the gap:

    val t : Time    = CURRRENT
    val i : Instant = CURRRENT

    t.tp   // Printed: 2021-01-21 09:36:31.761

    i.tp   // Printed: 2021-01-21 09:36:31.766.000.000

Note. Time.Instant is limited to range of years from 1677 to 2260

Source
Instant.scala
opaque type Length

Time.Length is an opaque Long value, holding total nanoseconds

Time.Length is an opaque Long value, holding total nanoseconds

Time.Length constructor methods are attached to primitives:

  1.Day.tp       // Prints: 1 day
  33.Millis.tp   // Prints: 0.033 sec
  10.Hours.tp    // Prints: 10 hours
  99999.Nanos.tp // Prints: 0.000099999 sec

Longest Time.Length possible is:

 Long.max.Nanos.tp  // Prints: 106751 days 23 hours 47 mins 16.854775807 secs
Source
Length.scala
opaque type Length

Time.Length is an opaque Long value, holding total nanoseconds

Time.Length is an opaque Long value, holding total nanoseconds

Time.Length constructor methods are attached to primitives:

  1.Day.tp       // Prints: 1 day
  33.Millis.tp   // Prints: 0.033 sec
  10.Hours.tp    // Prints: 10 hours
  99999.Nanos.tp // Prints: 0.000099999 sec

Longest Time.Length possible is:

 Long.max.Nanos.tp  // Prints: 106751 days 23 hours 47 mins 16.854775807 secs
Source
Length.scala
final class Period extends <>.X.Base[Time, Period]
Companion
object
Source
Period.scala
final class Period extends <>.X.Base[Time, Period]
Companion
object
Source
Period.scala
object X

Object X defines standard parent type extensions

Source
__.scala
object Zone extends Info

Alias

Inherited

Specialized buffer

Specialized buffer

Already parameterized generic buffer

Inherited from
Framework
Source
__.scala

Specialized collection

Specialized collection

Already parameterized generic collection

Inherited from
Framework
Source
__.scala

Type companion

Type companion

Holds methods to construct type instances

Inherited from
Framework
Source
__.scala
final val Fun: Long.Fun[Time]

Specialized functions

Specialized functions

Already parameterized set of generic functions

Inherited from
Framework
Source
__.scala
type Idx = Long.G.Idx[A]

Specialized indexed collection

Specialized indexed collection

Already parameterized generic indexed collection

Inherited from
Framework
Source
__.scala
final val Idx: Long.Idx[Time]

Type companion

Type companion

Holds methods to construct type instances

Inherited from
Framework
Source
__.scala
type Lookup[B] = Long.G.Lookup[A, B]

Specialized lookup collection

Specialized lookup collection

Already parameterized generic lookup collection

Inherited from
Framework
Source
__.scala
final val Lookup: Long.Lookup[Time]

Type companion

Type companion

Holds methods to construct type instances

Inherited from
Framework
Source
__.scala
type Opt = Long.G.Opt[A]

Specialized option

Specialized option

Already parameterized generic option

Inherited from
Framework
Source
__.scala
final val Opt: Long.Opt[Time]

Type companion

Type companion

Holds methods to construct type instances

Inherited from
Framework
Source
__.scala

Parameterized J.Ordering

Parameterized J.Ordering

Already parameterized generic J.Ordering

Inherited from
Framework
Source
__.scala
type Pro = Long.G.Pro[A]

Specialized property

Specialized property

Already parameterized generic property

Inherited from
Framework
Source
__.scala
final val Pro: Long.Pro[Time]

Type companion

Type companion

Holds methods to construct type instances

Inherited from
Framework
Source
__.scala
type Promise = Promise[A]

Parameterized Val.Promise

Parameterized Val.Promise

Already parameterized generic Val.Promise

Inherited from
Framework
Source
__.scala
inline def Promise: Ref.Promise[Time]

Type companion

Type companion

Holds methods to construct type instances

Inherited from
Framework
Source
__.scala
type Result = Result.type[A]

Parameterized Val.Result

Parameterized Val.Result

Already parameterized generic Val.Result

Inherited from
Framework
Source
__.scala
inline def Result: Ref.Result[Time]

Type companion

Type companion

Holds methods to construct type instances

Inherited from
Framework
Source
__.scala

Type alias

Type alias

Shortcut to Collection.StableSet

Inherited from
Framework
Source
__.scala

Companion alias

Companion alias

Holds methods to construct type instances

Inherited from
Framework
Source
__.scala

Def

inline def apply(): Time
Source
__.scala
def apply(day: Day, l: Length, ls: Length*): Time
Source
__.scala
def apply(i: Instant): Time
Source
__.scala
@targetName("current_Pro")
def current_*(changeEvery: Length): O
Source
__.scala
override def day: Day
Definition Classes
Source
__.scala
override def dayTime: DayTime
Definition Classes
Source
__.scala
def format(pattern: String): String

Format

Format

Formats time with given pattern

See java.text.SimpleDateFormat for details

 val t: Time = \/

 t.format("hh 'o`clock' a, z z z z") tp        // Prints: 07 o'clock PM, Eastern Standard Time

 t.format("yyyy.MM.dd G 'at' HH:mm:ss z") tp // Prints: 1969.12.31 AD at 19:00:00 EST

 t.format("EEE, MMM d, `yy") tp             // Prints: Wed, Dec 31, '69

 t.format("h:mm a") tp                       // Prints: 7:00 PM
Source
__.scala
inline def fromMillis(inline v: Long): Time
Source
__.scala
override def isVoid(v: Time): Boolean
Definition Classes
Type -> Longs -> Type -> Void
Source
__.scala
inline def millisTotal: Long
Source
__.scala
def skipTo(dt: DayTime): Time

Skip to next

Skip to next

Finds next greater instance of time with given DayTime

Note: The result may skip to next day

 val time = 2018.Year.start

 time tp                                   // Prints: 2018-01-01 0:00:00

 time.skipTo(16.Hours) tp                  // Prints: 2018-01-01 16:00:00

 time.skipTo(16.Hours).skipTo(10.Hours) tp // Prints: 2018-01-02 10:00:00
Source
__.scala
override def tag(v: Time): String
Definition Classes
Source
__.scala
inline def toGmt: Gmt

GMT Time

GMT Time

Built-in constructor to create Time.Gmt

Source
__.scala
inline def toInstant: Instant
Source
__.scala

Inherited

@targetName("plus")
inline def +(inline l: Length): Time
Inherited from
Millis
Source
Millis.scala
@targetName("plusAll")
inline def ++(inline s: ~[Length]): Time
Inherited from
Millis
Source
Millis.scala
@targetName("minus")
inline def -(inline l: Length): Time
Inherited from
Millis
Source
Millis.scala
@targetName("minusAll")
inline def --(inline s: ~[Length]): Time
Inherited from
Millis
Source
Millis.scala
@targetName("less")
inline def <[A <: RAW](inline v: A): Boolean

Less

Less

Returns true if current value is less than given, false - otherwise

Inherited from
Ordered
Source
Ordered.scala
@targetName("lessOrEqual")
inline def <=[A <: RAW](inline v: A): Boolean

Less or equal

Less or equal

Returns true if current value is less or equal to given, false - otherwise

Inherited from
Ordered
Source
Ordered.scala
@targetName("rangeX")
inline def <>>[A <: RAW](inline to: A): Long.G.<>[A]

Exclusive end range

Exclusive end range

Returns Range from current to given value exclusive

Note. Range uses base primitive natural ordering

Inherited from
Ordered
Source
Ordered.scala
@targetName("greater")
inline def >[A <: RAW](inline v: A): Boolean

Greater

Greater

Returns true if current value is greater than given, false - otherwise

Inherited from
Ordered
Source
Ordered.scala
@targetName("greaterOrEqual")
inline def >=[A <: RAW](inline v: A): Boolean

Greater or equal

Greater or equal

Returns true if current value is greater or equal to given, false - otherwise

Inherited from
Ordered
Source
Ordered.scala
@targetName("age")
def age: Length

Length to current.

Length to current.

Returns Length from this time to current time.

If this is in future, void Length is returned.

Inherited from
Base
Source
Base.scala
inline def atLeast[A <: RAW](v: A): A

Max

Max

Returns maximum of current or given value

Inherited from
Ordered
Source
Ordered.scala
inline def atMost[A <: RAW](v: A): A

Min

Min

Returns minimun of current or given value

Inherited from
Ordered
Source
Ordered.scala
inline def daysTotal: Long

Day count

Day count

Total days (24.Hours) which fit in this time unit

Inherited from
Millis
Source
Millis.scala
inline def emptyArray: Array[Time]

Empty array

Empty array

Returns singleton scala.Array.emptyLongArray

Inherited from
Framework
Source
__.scala
inline def hours: Long

Hours remainder

Hours remainder

Hours remainder when rounded by whole day (24 hours)

Value range is from 0 to 23

Inherited from
Millis
Source
Millis.scala
inline def hoursTotal: Long

Hours count

Hours count

Total hours which fit in this time unit

Inherited from
Millis
Source
Millis.scala
def info(v: Time): Info

Type to Info

Type to Info

Override this method to provide type standard Info implementation

Inherited from
Type
Source
Type.scala
@targetName("isFuture")
def isFuture: Boolean

Check if in future.

Check if in future.

Returns true if this time is greater than current.

Inherited from
Base
Source
Base.scala
@targetName("isPast")
def isPast: Boolean

Check if in past.

Check if in past.

Returns true if this time is less or equal to current.

Inherited from
Base
Source
Base.scala
final def isRef: Boolean
Inherited from
Type
Source
Type.scala
@targetName("lengthTo")
def lengthTo(that: Time): Length

Range duration

Range duration

Returns Length between this and that.

Inherited from
Base
Source
Base.scala
inline def micros: Long

Microseconds remainder

Microseconds remainder

Microseconds remainder when rounded by whole millisecond

Value range is from 0 to 999

Inherited from
Millis
Source
Millis.scala
inline def microsTotal: Long

Microseconds count

Microseconds count

Total microseconds which fit in this time unit

Inherited from
Millis
Source
Millis.scala
inline def millis: Long

Milliseconds remainder

Milliseconds remainder

Milliseconds remainder when rounded by whole second

Value range is from 0 to 999

Inherited from
Millis
Source
Millis.scala
inline def minutes: Long

Minutes remainder

Minutes remainder

Minutes remainder when rounded by whole hour

Value range is from 0 to 59

Inherited from
Millis
Source
Millis.scala
inline def minutesTotal: Long

Minutes count

Minutes count

Total minutes which fit in this time unit

Inherited from
Millis
Source
Millis.scala
@targetName("month")
def month: Month

Month.

Month.

Month, which includes this time instance.

Inherited from
Base
Source
Base.scala
val name: String
Inherited from
Type
Source
__.scala
inline def nanos: Long

Nanoseconds remainder

Nanoseconds remainder

Nanoseconds remainder when rounded by whole microsecond

Value range is from 0 to 999

Inherited from
Millis
Source
Millis.scala
@targetName("nanosTotal")
def nanosTotal: Long

Nanoseconds count

Nanoseconds count

Total nanoseconds which fit in this time unit

Note: Maximum duration expressed in nanoseconds is "7331 days, 10 hours, 50 mins, 44.854775807 secs". Unboxed over will cause problems

Inherited from
Millis
Source
Millis.scala
@threadUnsafe
Inherited from
Ordered
Source
Ordered.scala
inline def real: Long
Inherited from
Type
Source
__.scala
@targetName("roundTo")
def roundTo(l: Length)(using r: Rounding): Time
Inherited from
Millis
Source
Millis.scala
inline def seconds: Long

Seconds remainder

Seconds remainder

Seconds remainder when rounded by whole minute

Value range is from 0 to 59

Inherited from
Millis
Source
Millis.scala
inline def secondsTotal: Long

Seconds count

Seconds count

Total seconds which fit in this time unit

Inherited from
Millis
Source
Millis.scala
@targetName("toBrief")
def toBrief: String

Short String.

Short String.

Time is rounded to 1.Second.

For current Day, day portion is ommited.

Inherited from
Base
Source
Base.scala
@targetName("week")
Inherited from
Base
Source
Base.scala
inline def weeksTotal: Long
Inherited from
Millis
Source
Millis.scala
@targetName("year")
def year: Year

Year.

Year.

Year, which includes this time instance.

Inherited from
Base
Source
Base.scala