Net::ICal::Time

Net::ICal::Time package represents a time and date in Icalendar.
Download

Net::ICal::Time Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Shane Landrum
  • Publisher web site:
  • http://search.cpan.org/~srl/Net-ICal-0.15/lib/Net/ICal/Time.pm

Net::ICal::Time Tags


Net::ICal::Time Description

Net::ICal::Time package represents a time and date in Icalendar. Net::ICal::Time package represents a time and date in Icalendar.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' );WARNINGThis 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.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.METHODSnewCreates a new time object given one of:epoch => integer seconds past the POSIX epoch.ical => iCalendar date-time stringIf 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.use Net::ICal::Time; my $t1 = new Net::ICal::Time(ical => '20010402');ok(defined($t1), 'simple iCal creation test (date only)');print $t1->as_ical . "n";# note: there *should* be a Z on the end of the string, because we assume # that new dates are in UTC unless otherwise specified. ok($t1->as_ical eq ':20010402Z', 'simple iCal creation (date only) makes correct iCal');# TODO: define more tests in this vein that are Net::ICal specific. # Mostly, you want the tests here to be Date::ICal tests; # Don't just add tests here unless they test something specific to N::I.clone()Create a new copy of this time.zoneAccessor 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.}; =end testingas_ical()Convert to an iCal format property string.as_localtime()Convert to list format, as per localtime(). This is *not* timezone safe.as_gmtime()Convert to list format, as per gmtime()day_of_week()Return 0-6 representing day of week of this date.day_of_year()Return 1-365 representing day of year of this date.start_of_week()Return the day of year of the first day (Sunday) of the week that this date is in Requirements: · Perl


Net::ICal::Time Related Software