You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using Dates
julia> dt =DateTime(2018, 1, 1)
2018-01-01T00:00:00
julia> dt =DateTime(2018, 1, 1);
julia> a = dt:Hour(1):dt +Hour(5);
julia> b = dt +Hour(2):Hour(1):dt +Hour(7);
julia>intersect(a,b)
ERROR: MethodError: no method matching rem(::Millisecond, ::Hour)
Closest candidates are:rem(::Any, ::Any, ::RoundingMode{:ToZero}) at div.jl:67rem(::Any, ::Any, ::RoundingMode{:Down}) at div.jl:68rem(::Any, ::Any, ::RoundingMode{:Up}) at div.jl:69...
Stacktrace:
[1] intersect(::StepRange{DateTime,Hour}, ::StepRange{DateTime,Hour}) at ./range.jl:852
[2] top-level scope at REPL[7]:1
julia>intersect(collect(a), b) # Works, but returns a vector rather than a StepRange4-element Array{DateTime,1}:2018-01-01T02:00:002018-01-01T03:00:002018-01-01T04:00:002018-01-01T05:00:00
julia>@whichintersect(a, b)
intersect(r::StepRange, s::StepRange) in Base at range.jl:822
julia>@whichintersect(collect(a), b)
intersect(itr, itrs...) in Base at array.jl:2566
julia>versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-2323:17 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
CPU:Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
WORD_SIZE:64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
JULIA_MPI_PATH =/usr/local/Cellar/open-mpi/4.0.3/
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: