Net::ICal::Period -- represent a period of time


NAME

Net::ICal::Period -- represent a period of time


SYNOPSIS

  use Net::ICal;
  $p = new Net::ICal::Period("19970101T120000","19970101T123000");
  $p = new Net::ICal::Period("19970101T120000","PT3W2D40S");
  $p = new Net::ICal::Period(time(),3600);
  $p =   new Net::ICal::Period(
                      new Net::ICal::Time("19970101T120000",
                                          "America/Los_Angeles"),
                      new Net::ICal::Duration("2h"));


DESCRIPTION

Use this to make an object representing a block of time on a real schedule. You can either say, ``This event starts at 12 and ends at 2'' or ``This event starts at 12 and lasts 2 hours.''

These two ways of specifying events can be treated differently in schedules. If you say, ``The meeting is from 12 to 2, but I have to leave at 2,'' you are implying that the start date and end date are fixed. If you say, ``I have a 2-hour drive to Chicago, and I need to leave at 4,'' you are saying that it will take 2 hours no matter when you leave, and that moving the start time will slide the end time correspondingly.


BASIC METHODS

new($time, $time|$duration)

Creates a new period object given to parameters: The first must be a Time object or valid argument to Net::ICal::Time::new.

The second can be either:

Either give a start time and an end time, or a start time and a duration.

new($time, $time|$duration)

Creates a new period object given to parameters: The first must be a Time object or valid argument to Net::ICal::Time::new.

The second can be either:

Either give a start time and an end time, or a start time and a duration.

is_valid()

Return true if: There is an end time and: Both start and end times have no timezone ( Floating time) or Both start and end time have (possibly different) timezones or Both start and end times are in UTC and The end time is after the start time.

  There is a duration and the duration is positive
 Net::ICal::Period -- represent a period of time