Time
Time can represent a single point in time (unix time) or a duration both positive and negative. It is backed by a 128bit integer that counts the total number of ticks
and can represent a range of [-5, +5] eons with an accuracy of 1 zeptosecond (10^-21).
graph BT
N1["Time"] -->|inherits| N2["Stringable"];
N2["Stringable"] -->|inherits| N3["Any"];
Characteristics
Quality | Value |
---|---|
Inherits | Stringable |
Extends | N/A |
Decorators | N/A |
Is enum | false |
Is sealed | false |
Is extern | false |
Is abstract | false |
Is generator | false |
Has value semantics | true |
Has stored properties | true |
Should register destructor | false |
Has atomic memory | true |
Is copy assignable | true |
Is zero initializable | true |
Const Expressions
kZeptosInSecond
const! kZeptosInSecond = 1000000000000000000000 Int128
kAttosInSecond
const! kAttosInSecond = 1000000000000000000 Int128
kFemtosInSecond
const! kFemtosInSecond = 1000000000000000 Int128
kPicosInSecond
const! kPicosInSecond = 1000000000000 Int128
kNanosInSecond
const! kNanosInSecond = 1000000000 Int128
kMicrosInSecond
const! kMicrosInSecond = 1000000 Int128
kMillisInSecond
const! kMillisInSecond = 1000 Int128
kSecondsInMinute
const! kSecondsInMinute = 60 Int128
kMinutesInHour
const! kMinutesInHour = 60 Int128
kHoursInDay
const! kHoursInDay = 24 Int128
kDaysInYear
const! kDaysInYear = 365 Int128
kYearsInEon
const! kYearsInEon = 1000000000 Int128
kMetricStep
const! kMetricStep = 1000 Int128
kZeptosShift
const! kZeptosShift = 1 Int128
kAttosShift
const! kAttosShift = 1000 Int128
kFemtosShift
const! kFemtosShift = 1000000 Int128
kPicosShift
const! kPicosShift = 1000000000 Int128
kNanosShift
const! kNanosShift = 1000000000000 Int128
kMicrosShift
const! kMicrosShift = 1000000000000000 Int128
kMillisShift
const! kMillisShift = 1000000000000000000 Int128
kSecondsShift
const! kSecondsShift = 1000000000000000000000 Int128
kMinutesShift
const! kMinutesShift = 60000000000000000000000 Int128
kHoursShift
const! kHoursShift = 3600000000000000000000000 Int128
kDaysShift
const! kDaysShift = 86400000000000000000000000 Int128
kWeeksShift
const! kWeeksShift = 604800000000000000000000000 Int128
kSemestersShift
const! kSemestersShift = 10886400000000000000000000000 Int128
kYearsShift
const! kYearsShift = 31536000000000000000000000000 Int128
kDecadesShift
const! kDecadesShift = 315360000000000000000000000000 Int128
kCenturiesShift
const! kCenturiesShift = 3153600000000000000000000000000 Int128
kMillenniaShift
const! kMillenniaShift = 31536000000000000000000000000000 Int128
kEonsShift
const! kEonsShift = 31536000000000000000000000000000000000 Int128
Functions
now
#Gambol.function.nounwind
#Gambol.function.alwaysinline
now () -> Time
checkpoint
#Gambol.function.nounwind
#Gambol.function.alwaysinline
checkpoint () -> Time
min
#Gambol.function.nounwind
min () -> Time
max
#Gambol.function.nounwind
max () -> Time
Methods
construct
#default
#Gambol.function.alwaysinline
construct (s @Self) -> Self
sign
#Gambol.function.nounwind
sign (s @Self) -> Int128
abs
#Gambol.function.nounwind
abs (s @Self) -> Time
str
str (s @Self) -> String
zeptos
#Gambol.function.nounwind
zeptos (s @Self, v Int128 = 0) -> Self
v
zeptoseconds to self
zeptos_only
#Gambol.function.nounwind
zeptos_only (s @Self) -> Int128
total_zeptos
#Gambol.function.nounwind
total_zeptos (s @Self) -> Int128
frac_zeptos
#Gambol.function.nounwind
frac_zeptos (s @Self) -> Int128
attos
#Gambol.function.nounwind
attos (s @Self, v Int128 = 0) -> Self
v
attoseconds to self
attos_only
#Gambol.function.nounwind
attos_only (s @Self) -> Int128
total_attos
#Gambol.function.nounwind
total_attos (s @Self) -> Int128
frac_attos
#Gambol.function.nounwind
frac_attos (s @Self) -> Int128
femtos
#Gambol.function.nounwind
femtos (s @Self, v Int128 = 0) -> Self
v
femtoseconds to self
femtos_only
#Gambol.function.nounwind
femtos_only (s @Self) -> Int128
total_femtos
#Gambol.function.nounwind
total_femtos (s @Self) -> Int128
frac_femtos
#Gambol.function.nounwind
frac_femtos (s @Self) -> Int128
picos
#Gambol.function.nounwind
picos (s @Self, v Int128 = 0) -> Self
v
picoseconds to self
picos_only
#Gambol.function.nounwind
picos_only (s @Self) -> Int128
total_picos
#Gambol.function.nounwind
total_picos (s @Self) -> Int128
frac_picos
#Gambol.function.nounwind
frac_picos (s @Self) -> Int128
nanos
#Gambol.function.nounwind
nanos (s @Self, v Int128 = 0) -> Self
v
nanoseconds to self
nanos_only
#Gambol.function.nounwind
nanos_only (s @Self) -> Int128
total_nanos
#Gambol.function.nounwind
total_nanos (s @Self) -> Int128
frac_nanos
#Gambol.function.nounwind
frac_nanos (s @Self) -> Int128
micros
#Gambol.function.nounwind
micros (s @Self, v Int128 = 0) -> Self
v
microseconds to self
micros_only
#Gambol.function.nounwind
micros_only (s @Self) -> Int128
total_micros
#Gambol.function.nounwind
total_micros (s @Self) -> Int128
frac_micros
#Gambol.function.nounwind
frac_micros (s @Self) -> Int128
millis
#Gambol.function.nounwind
millis (s @Self, v Int128 = 0) -> Self
v
milliseconds to self
millis_only
#Gambol.function.nounwind
millis_only (s @Self) -> Int128
total_millis
#Gambol.function.nounwind
total_millis (s @Self) -> Int128
frac_millis
#Gambol.function.nounwind
frac_millis (s @Self) -> Int128
seconds
#Gambol.function.nounwind
seconds (s @Self, v Int128 = 0) -> Self
v
seconds to self
seconds_only
#Gambol.function.nounwind
seconds_only (s @Self) -> Int128
total_seconds
#Gambol.function.nounwind
total_seconds (s @Self) -> Int128
minutes
#Gambol.function.nounwind
minutes (s @Self, v Int128 = 0) -> Self
v
minutes to self
minutes_only
#Gambol.function.nounwind
minutes_only (s @Self) -> Int128
total_minutes
#Gambol.function.nounwind
total_minutes (s @Self) -> Int128
hours
#Gambol.function.nounwind
hours (s @Self, v Int128 = 0) -> Self
v
hours to self
hours_only
#Gambol.function.nounwind
hours_only (s @Self) -> Int128
total_hours
#Gambol.function.nounwind
total_hours (s @Self) -> Int128
days
#Gambol.function.nounwind
days (s @Self, v Int128 = 0) -> Self
v
days to self
days_only
#Gambol.function.nounwind
days_only (s @Self) -> Int128
total_days
#Gambol.function.nounwind
total_days (s @Self) -> Int128
weeks
#Gambol.function.nounwind
weeks (s @Self, v Int128 = 0) -> Self
v
weeks to self
total_weeks
#Gambol.function.nounwind
total_weeks (s @Self) -> Int128
semesters
#Gambol.function.nounwind
semesters (s @Self, v Int128 = 0) -> Self
v
semesters to self
total_semesters
#Gambol.function.nounwind
total_semesters (s @Self) -> Int128
years
#Gambol.function.nounwind
years (s @Self, v Int128 = 0) -> Self
v
years to self
years_only
#Gambol.function.nounwind
years_only (s @Self) -> Int128
total_years
#Gambol.function.nounwind
total_years (s @Self) -> Int128
decades
#Gambol.function.nounwind
decades (s @Self, v Int128 = 0) -> Self
v
decades to self
total_decades
#Gambol.function.nounwind
total_decades (s @Self) -> Int128
centuries
#Gambol.function.nounwind
centuries (s @Self, v Int128 = 0) -> Self
v
centuries to self
total_centuries
#Gambol.function.nounwind
total_centuries (s @Self) -> Int128
millennia
#Gambol.function.nounwind
millennia (s @Self, v Int128 = 0) -> Self
v
millennia to self
total_millennia
#Gambol.function.nounwind
total_millennia (s @Self) -> Int128
eons
#Gambol.function.nounwind
eons (s @Self, v Int128 = 0) -> Self
v
eons to self
total_eons
#Gambol.function.nounwind
total_eons (s @Self) -> Int128
Unary Operators
-
#Gambol.function.nounwind
- (s @Self) -> Time
Binary Operators
=
#default
#Gambol.function.nounwind
= (s @Self, o @Self) -> Self
==
#Gambol.function.nounwind
== (s @Self, o @Self) -> Bool
<
#Gambol.function.nounwind
< (s @Self, o @Self) -> Bool
<=
#Gambol.function.nounwind
<= (s @Self, o @Self) -> Bool
>
#Gambol.function.nounwind
> (s @Self, o @Self) -> Bool
>=
#Gambol.function.nounwind
>= (s @Self, o @Self) -> Bool
+
#Gambol.function.nounwind
+ (s @Self, o @Self) -> Time
+=
#Gambol.function.nounwind
+= (s @Self, o @Self) -> Self
-
#Gambol.function.nounwind
- (s @Self, o @Self) -> Time
-=
#Gambol.function.nounwind
-= (s @Self, o @Self) -> Self
*
#Gambol.function.nounwind
* (s @Self, o Int128) -> Time
*=
#Gambol.function.nounwind
*= (s @Self, o Int128) -> Self
/
#Gambol.function.nounwind
/ (s @Self, o Int128) -> Time
/=
#Gambol.function.nounwind
/= (s @Self, o Int128) -> Self
%
#Gambol.function.nounwind
% (s @Self, o @Self) -> Time
%=
#Gambol.function.nounwind
%= (s @Self, o @Self) -> Self
Casts To
- Bool
Properties
total_ticks
total_ticks Int128