I have two times, t1 and t2 and I wish to find the duration between these. The standard answer provided by Julia appears to be in milliseconds (and Julia also states milliseconds as part of its output). However, I need the difference converted to an integer, which captures the difference in nearest whole minutes.
I seem to hit a snag when I divide by 60000 to convert, so I wonder what the proper method is.
The problem is part of a function that I have written, which first converts a strings to dates and times, and then subtracts these from now. The output is in milliseconds:
function timeToStart(stringTime)
allTimes = []
for i = 1:length(stringTime)
time = Dates.DateTime(stringTime[i,1], "Y-mm-ddTH:MM:SS.SSSZ") - Dates.now()
allTimes = [allTimes;time]
end
return allTimes
end
When I then take an element in the output, and divide by 60000, I get the error:
**InexactError: Int64(10.61605)**
in top-level scope at [ApiNgDemoJsonRpc.jl:318](#)
in / at [stdlib\v1.4\Dates\src\periods.jl:79](#)
in Millisecond at [stdlib\v1.4\Dates\src\types.jl:33](#)
in convert at [base\number.jl:7](#)
in Int64 at [base\float.jl:710](#)