Periods
AstroTime.Periods.AstroPeriod
— TypeAstroPeriod{U, T}(unit, Δt) where {U<:TimeUnit, T}
An AstroPeriod
object represents a time interval of Δt
with a TimeUnit
of unit
. Periods should be constructed via the shorthand syntax shown in the examples below.
Examples
julia> 3.0seconds
3.0 seconds
julia> 1.0minutes
1.0 minutes
julia> 12hours
12.0 hours
julia> days_per_year = 365
365
julia> days_per_year * days
365.0 days
julia> 10.0years
10.0 years
julia> 1centuries
1.0 centuries
AstroTime.Periods.TimeUnit
— TypeAll time units are subtypes of the abstract type TimeUnit
. The following time units are defined:
Second
Minute
Hour
Day
Year
Century
AstroTime.Periods.unit
— Methodunit(p::AstroPeriod)
Return the unit of the period p
.
Examples
julia> unit(3.0seconds)
AstroTime.Periods.Second()
AstroTime.Periods.value
— Methodvalue(p::AstroPeriod)
Return the unitless value of the period p
.
Examples
julia> value(3.0seconds)
3.0