@@ -287,50 +287,6 @@ The C<Str> method returns a string of the form 'yyyy-mm-dd'.
287
287
$d + 3 # Date.new('2010-12-27')
288
288
3 + $d # Date.new('2010-12-27')
289
289
290
- =head1 C<Interval>
291
-
292
- C<Interval> represents spans of time. They are similar to C<Duration>s except
293
- that you can specify spans of time beyond just seconds.
294
-
295
- my $passed = Interval.new( :years(5), :months(0), :days(12),
296
- :hours(10), :minutes(2), :seconds(0) );
297
-
298
- The named arguments form works similar to the C<DateTime> named arguments form,
299
- except for the pluralized argument names in C<Interval> objects.
300
-
301
- Un-specified arguments default to zero, so the above could more simply be
302
- written as
303
-
304
- my $passed = Interval.new( :years(5), :days(12), :hours(10), :minutes(2) );
305
-
306
- An ISO 8601 Interval string is also permissable, with omitted fields defaulting
307
- to zero. The ISO 8601 version of the above would be either of the following:
308
-
309
- my $passed = Interval.new("P5Y12DT102M");
310
- my $passed = Interval.new("P0005-00-12T10:02:00");
311
-
312
- The C<"P[weeks]W"> form works as well. The following are equivalent:
313
-
314
- my $weeks = Interval.new("P6W");
315
- my $weeks = Interval.new("P42D");
316
-
317
- Fractions are allowed for the most granular value specified only.
318
-
319
- =head2 Accessor Methods
320
-
321
- The following methods on a C<Interval> object return a duration in that unit of
322
- time as either an C<Int> or a C<Rat>, whichever is narrower.
323
-
324
- years
325
- months (assumes 30-day months)
326
- weeks
327
- days
328
- hours
329
- minutes
330
- seconds
331
-
332
- The C<Str> method returns the interval as an valid ISO-8601 duration.
333
-
334
290
=head1 FOOTNOTE
335
291
336
292
The authors of the current rewrite want to mention, with thanks, the
0 commit comments