So I have these two DateTime objects, and I subtract them to get an interval. Great! Now I want to find out how long that interval is in minutes.
Uh, you can't, because my interval spans nearly three days' worth of time. And since in some weird edge cases a day might not equal 24 hours, DateTime::Interval therefore provides no method at all for letting me get the length of my interval in minutes making standard assumptions.
Re:DateTime::Format::Duration
jdavidb on 2006-07-10T20:38:42
The last time I checked (this morning), it did not do what I wanted. It could tell me the minutes component of the interval, but it could not convert the days, hours, and minutes to a total number of minutes. Unless I'm missing something, and if so, please point it out, because you will really help me.
Re:DateTime::Format::Duration
monsterzero on 2006-07-10T20:49:25
Have you seen my post on this?Re:DateTime::Format::Duration
jdavidb on 2006-07-10T20:58:59
Yes, I did, and thank you! I'd discovered delta_ms by that time. However, it still does not really DWIM. If I have real Date objects, I should be able to subtract them and get an interval that can be converted to whatever resolution or units I want. The problem then is that I have to do something unintuitive with my DateTimes: intuitively, I had written
and expected to get something that I could express as minutes. I shouldn't have to perform something other than subtraction in order to get such a result.$end - $startBut at least it is possible, and for that I am grateful.
:) Re:DateTime::Format::Duration
autarch on 2006-07-10T20:55:41
I think you'd be best served by writing a message to datetime@perl.org outlining what you want to do.