The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::ICal::Time -- represent a time and date

SYNOPSIS

    $t = Net::ICal::Time->new( epoch => time );
    $t = Net::ICal::Time->new( ical => '19970101' );
    $t = Net::ICal::Time->new( ical => '19970101T120000',
        timezone => 'America/Los_Angeles' );

    # Eventually ...
    $t = Net::ICal::Time-new( iso => '1997-10-14' );
    # or other time formats ...

    # Not yet implemented
    $t = Net::ICal::Time->new(
        second => 12,
        minute => 5,
        hour => 6,
        day => 10,
        month => 9,
        year => 1997,
    );

    # Not yet implemented
    $t2 = $t->add( hour => '6' );
    

WARNING

This is ALPHA QUALITY CODE. Due to a roundoff error in Date::ICal, which it's based on, addition and subtraction is often one second off. Patches welcome. See the README that came with this module for how you can help.

DESCRIPTION

Time represents a time, but can also hold the time zone for the time and indicate if the time should be treated as a date. The time can be constructed from a variey of formats.

METHODS

new

Creates a new time object given one of:

  • epoch => integer seconds past the POSIX epoch.

  • ical => iCalendar date-time string

If neither of these arguments is supplied, the value will default to the current date.

WARNING: Timezone handling is currently in flux in Net::ICal, pending Date::ICal awareness of timezones. This may change the call syntax slightly.

clone()

Create a new copy of this time.

zone

Accessor to the timezone. Takes & Returns an Olsen place name ("America/Los_Angeles", etc. ) , an Abbreviation, 'UTC', or 'float' if no zone was specified.

THIS IS NOT YET IMPLEMENTED. Date::ICal does not yet support timezones.

add($duration)

Takes a duration string or Duration and returns a Time that is the sum of the time and the duration. Does not modify this time.

subtract($time)

Subtract out a time of type Time and return a Duration. Does not modify this time.

move_to_zone($zone);

Change the time to what it would be in the named timezone. The zone can be an Olsen placename or "UTC".

THIS FUNCTION IS NOT YET IMPLEMENTED. We're waiting on Date::ICal to provide this function.