[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Kaj Wiik
You can get Int64 value by duration.value and convert 'by hand' from there. A possibility to convert from Millisecond to DateTime would be nice... On Saturday, August 15, 2015 at 2:41:04 AM UTC+3, Ian Butterworth wrote: Trying to get the number of hours between these two dates (ideally x

[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Jeffrey Sarnoff
https://lh3.googleusercontent.com/-ozWWsLO25j8/Vc8HjJQDDTI/AWY/aKAqTYCKOOo/s1600/%2521yikes%2521.png Good morning, .. and I expected that would work .. that the period operators would cooperate differently. You deserve a more satisying introduction to basic stuff with time intervals.

[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Jeffrey Sarnoff
On Saturday, August 15, 2015 at 5:59:36 AM UTC-4, Kaj Wiik wrote: You can get Int64 value by duration.value and convert 'by hand' from there. A possibility to convert from Millisecond to DateTime would be nice... There should be durationAB = DateTimeB - DateTimeA

[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Jeffrey Sarnoff
Ian -- I can imagine a long-winded solution where the relevant time units are extracted and differenced, but I was hoping for simpler.. -- as you should! When I saw you use Hour in the first example, I thought you were doing some thing where hour counts were the focus ... (I will prepare

[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Jeffrey Sarnoff
well that's accurate -- I was not trying to make them nefarious, I mistook the emphasis. I will come back with a more fully driveable example in about 15mins. On Friday, August 14, 2015 at 7:41:04 PM UTC-4, Ian Butterworth wrote: Trying to get the number of hours between these two dates

Re: [julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Jeffrey Sarnoff
If you email me a description of how it had been planned to word (doing what, using which underpinning funs) .. , I will give that a go. On Sat, Aug 15, 2015 at 1:00 PM, Jacob Quinn quinn.jac...@gmail.com wrote: Yeah, it's forthcoming. I left it out originally just to be conservative in code

[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Ian Butterworth
Thanks guys. I ended up using Kaj's approach. Functionality like we discussed would be good if possible. On Saturday, 15 August 2015 06:16:09 UTC-4, Jeffrey Sarnoff wrote: What would like two lines of code to do with durations? On Friday, August 14, 2015 at 7:41:04 PM UTC-4, Ian Butterworth

Re: [julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Jacob Quinn
Yeah, it's forthcoming. I left it out originally just to be conservative in code and function, but it's come up enough that we should add it in for TimePeriods. A good up for grabs kind of PR if anyone's feeling up for it. -Jacob On Sat, Aug 15, 2015 at 10:59 AM, Ian Butterworth

[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-14 Thread Jeffrey Sarnoff
Dates.Hour, .. Dates.Millisecond what to put their parens around DateTime entities only. Dates.Year. .. Dates.Day are more open-minded, enparenning DateTime or Date entities. take 'em for a spin like this: Dates.Hour(time_series[2]) - Dates.Hour(time_series[1]) Here's to a Good Evening

[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-14 Thread Ian Butterworth
I took 'em for a spin, but your approach doesn't have legs if the datetimes in time_series come from different days. I.e. Dates.Hour just returns the hour in that day. I can imagine a long-winded solution where the relevant time units are extracted and differenced, but I was hoping for