> I'm not sure why the original poster wanted this. The only good use case I > can think of would be when you have a duration of seconds only and you > want to divide it, in which case it's not that hard to do something like: > > my $new_dur = > DateTime::Duration->new( seconds => int( $dur->seconds / 25 ) ); >
I'm a runner. For example last week was a 10k race. I have the time stored in a DateTime::Duration object. Now I want to divide this by 10 and so I have the time I've needed for a single kilometre. Of course it is easy to compute that by myself. But I wanted to try to do it with a DateTime::Duration object. In my case I am only interested in hours, minutes, seconds and fraction of a second. For a race the date does not matter. Only the absolute time needed. I understand when you say that a month cannot be divided because it is dependent which month it is, ... Because my duration is not only of seconds I think that it is easier to do this simple task without DateTime::Duration. Of course I convert the time consisting of e.g. hours, niutes, seconds and fraction of a second into seconds and then do the computations and then convert it back. At the end I'm computing only with seconds. But in this simple case a minute is always 60 seconds and an hour always 3600 seconds.