(forwarding back to the list)

2006/4/25, Luke Hankins <[EMAIL PROTECTED]>:
> * Flavio S. Glock wrote:
> > Would you mind providing a (non)working example?
>
> Hurm.  The act of distilling it down to an example seems to have gotten it
> working.  Off to dig further. :-)
>
> This is slightly harder because DateTime::Format::Duration won't install on
> my machine due to test issues.  Is there an easy way to get the length of
> a Duration in seconds without using that module?

The way how to calculate seconds depends a lot on the context where
the result will be used.

One of the possible ways is to not use Duration at all - instead, you
can add a "difference" to a datetime:

  $dt = $dt + ( $dt_max - $dt_min );

> > OTOH, you can specify span durations using full hours (spansets are
> > created using the 'before' parameter by default):
> >
> >         DateTime::SpanSet->from_set_and_duration(
> >                set => DateTime::Event::Recurrence->daily( hours => $min),
> >                hours => 1+$max-$min,
> >        )->set_time_zone('America/New_York');
>
> Ooh, good point.  I wrote that before I understood the difference between
> "end" and "before".
>
> Thanks!
>

np.

- Flavio S. Glock

Reply via email to