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 simpler.. Good evening to you too On Friday, 14 August 2015 20:01:05 UTC-4, Jeffrey Sarnoff wrote: > > 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 > 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 (ideally "x >> hours and y minutes"), but can't figure out how to convert the duration >> variable into hours. The bottom line currently errors >> >> timein = "2015/8/13 10:19:50" >> timein2 = "2015/8/14 13:12:34" >> >> time_series[1] = DateTime(timein,"yyyy/mm/dd HH:MM:SS") >> time_series[2] = DateTime(timein2,"yyyy/mm/dd HH:MM:SS") >> >> duration = time_series[2]-time_series[1] >> Dates.Hour(duration) >> >
