The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::SDP::Time - Time Description in an SDP file

SYNOPSIS

  my $time = $sdp->new_time_desc();

  print "Session started: ".$time->start_time();
  
  $time->make_permanent();

DESCRIPTION

This class represents a single Time Description (t=) in an SDP file. When parsing an SDP file, Net::SDP will create an instance of Net::SDP::Time for each time description. New time descriptions can be created using the new_time_desc() method in Net::SDP.

METHODS

start_time_ntp()

Get or Set the Start Time as decimal representation of Network Time Protocol (NTP) time values in seconds. [t=]

Example:

        $start_ntp = $time->start_time_ntp();
        $time->start_time_ntp( 3303564104 );
end_time_ntp()

Get or Set the End Time as decimal representation of Network Time Protocol (NTP) time values in seconds. [t=]

Example:

        $end_ntp = $time->end_time_ntp();
        $time->end_time_ntp( 3303567704 );
start_time_unix()

Get or Set the Start Time as decimal Unix time stamp. [t=]

Example:

        $start = $time->start_time_unix();
        $time->start_time_unix( time() );
end_time_unix()

Get or Set the End Time as decimal Unix time stamp. [t=]

Example:

        $end = $time->end_time_unix();
        $time->end_time_unix( time()+3600 );
start_time()

Get a textual representation of the Start Time. [t=]

Example:

        print "Session starts: ".$time->start_time();
end_time()

Get a textual representation of the End Time. [t=]

Example:

        print "Session ends: ".$time->end_time();
is_permanent()

Returns true if the session is permanent. Returns false if the session has a start or end time. [t=]

make_permanent()

Makes the session permanent - no start or end time. [t=]

is_unbounded()

Returns true if the session has no end time. Returns false if the session has an end time. [t=]

make_unbounded()

Makes the session unbounded - no end time. [t=]

as_string()

Returns a textual representation/summary of the time description.

Example:

        'Tue Aug  2 11:13:28 2004 until Tue Aug  2 13:15:00 2004'

AUTHOR

Nicholas Humfrey, njh@ecs.soton.ac.uk

COPYRIGHT AND LICENSE

Copyright (C) 2004 University of Southampton

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.005 or, at your option, any later version of Perl 5 you may have available.