TimeNum

scalation.TimeNum
See theTimeNum companion class
object TimeNum

The TimeNum companion object is used to represent and operate on date-time values. It contains an implicit class definition for TimeNum, which extends Instant with Numeric operations that can be used in VectorT. The java.time.Instant class stores nano-seconds since the UNIX Epoch using a long for seconds and int for nano-seconds (12 bytes or 96 bits). The java.time.ZonedDateTime class is used with it to handle various date-time formats.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TimeNum.type

Members list

Value members

Concrete methods

def abs(t: TimeNum): TimeNum

Return the absolute value of that date-time number.

Return the absolute value of that date-time number.

Value parameters

t

that date-time number

Attributes

def apply(sec: Long, ns: Int): TimeNum

Create a TimeNum object from Number of seconds that have elapsed since January 1, 1970 UTC.

Create a TimeNum object from Number of seconds that have elapsed since January 1, 1970 UTC.

Value parameters

ns

the number of nano-seconds

sec

the number of seconds

Attributes

def apply(dt: String, dtPattern: String): TimeNum

Create a TimeNum object by adding default time values.

Create a TimeNum object by adding default time values.

Value parameters

dt

the date-time in string format

dtPattern

the pattern/format for the date-time

Attributes

def apply(dt_: String): TimeNum

Create a TimeNum object by adding some default time values, this version does not accept date pattern from user, it makes a best guess.

Create a TimeNum object by adding some default time values, this version does not accept date pattern from user, it makes a best guess.

Value parameters

dt_

the date-time in string format

Attributes

def double2TimeNum(d: Double): TimeNum

Convert from Double to TimeNum.

Convert from Double to TimeNum.

Value parameters

d

the Double parameter to convert

Attributes

def fromDouble(d: Double): TimeNum

Create a TimeNum number from a Double, where the seconds are extracted from the whole number part and the nanoseconds from the fractional part.

Create a TimeNum number from a Double, where the seconds are extracted from the whole number part and the nanoseconds from the fractional part.

Value parameters

d

the source double

Attributes

def fromInt(n: Int): TimeNum

Create a TimeNum number from an Int, where the seconds are given by n and the default (0) is used for the nanoseconds.

Create a TimeNum number from an Int, where the seconds are given by n and the default (0) is used for the nanoseconds.

Value parameters

n

the source integer

Attributes

Create a TimeNum number from a ValueType holding a TimeNum.

Create a TimeNum number from a ValueType holding a TimeNum.

Value parameters

dt

the date-time as a ValueType

Attributes

def max(s: TimeNum, t: TimeNum): TimeNum

Return the maximum of two date-time number, s and t.

Return the maximum of two date-time number, s and t.

Value parameters

s

the first date-time number to compare

t

the second date-time number to compare

Attributes

def min(s: TimeNum, t: TimeNum): TimeNum

Return the minimum of two date-time numbers, s and t.

Return the minimum of two date-time numbers, s and t.

Value parameters

s

the first date-time number to compare

t

the second date-time number to compare

Attributes

def setThreshold(thres: Double): Unit

Set the threshold to value more suitable to the current application.

Set the threshold to value more suitable to the current application.

Value parameters

thres

the new value for the threshold

Attributes

def signum(t: TimeNum): Int

Return the signum (sgn) of a TimeNum.

Return the signum (sgn) of a TimeNum.

Value parameters

t

the date-time to obtain the signum of

Attributes

def sqrt(t: TimeNum): TimeNum

Return the square root of a TimeNum.

Return the square root of a TimeNum.

Value parameters

t

the date-time to obtain the square root of

Attributes

Concrete fields

val DAY: Long

Default date-time format month, day, year, hour (24), minute, second, nano-seconds zone

Default date-time format month, day, year, hour (24), minute, second, nano-seconds zone

Attributes

val DEFAULT_TZ: String

Define the default time zone to be Coordinated Universal Time (UTC). UTC is the successor to Greenwich Mean Time (GMT) that was developed at Royal Observatory in Greenwich, UK (0° longitude). UTC does not observe Daylight Savings Time and serves as universal time across regions/time zones.

Define the default time zone to be Coordinated Universal Time (UTC). UTC is the successor to Greenwich Mean Time (GMT) that was developed at Royal Observatory in Greenwich, UK (0° longitude). UTC does not observe Daylight Savings Time and serves as universal time across regions/time zones.

Attributes

See also

en.wikipedia.org/wiki/Coordinated_Universal_Time

val HOUR: Long
val MINUTE: Long
val SECOND: Long
val WEEK: Long
val _0: TimeNum

TimeNum (0) as a date-time corresponding to 01-01-1970 00:00:00 UTC, the UNIX Epoch (00:00:00 UTC on Thursday, 1 January 1970)

TimeNum (0) as a date-time corresponding to 01-01-1970 00:00:00 UTC, the UNIX Epoch (00:00:00 UTC on Thursday, 1 January 1970)

Attributes

val _1: TimeNum

TimeNum (1) as a date-time corresponding to 01-02-1970 00:00:00 UTC NoteL: _1 was arbitrarily chosen as one day rather than another time unit

TimeNum (1) as a date-time corresponding to 01-02-1970 00:00:00 UTC NoteL: _1 was arbitrarily chosen as one day rather than another time unit

Attributes

val _2: TimeNum
val _3: TimeNum
val _4: TimeNum
val _5: TimeNum
val _6: TimeNum
val nanoLimit: Int

Nano-seconds must be strictly than this limit (billion nanoseconds = 1 second)

Nano-seconds must be strictly than this limit (billion nanoseconds = 1 second)

Attributes

TimeNum missing date-time

TimeNum missing date-time

Attributes

val ord: Ordering[TimeNum]

Ordering for date-time values

Ordering for date-time values

Attributes