GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::SDP::TIME (3)

.ds Aq ’

NAME

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

CONTENTS

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

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

Example:



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



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

Example:



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



<B>B>start_time_unix()<B>B> Get or Set the Start Time as decimal Unix time stamp. <B>[t=]B>

Example:



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



<B>B>end_time_unix()<B>B> Get or Set the End Time as decimal Unix time stamp. <B>[t=]B>

Example:



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



<B>B>start_time()<B>B> Get a textual representation of the Start Time. <B>[t=]B>

Example:



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



<B>B>end_time()<B>B> Get a textual representation of the End Time. <B>[t=]B>

Example:



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



<B>B>is_permanent()<B>B> Returns true if the session is permanent. Returns false if the session has a start or end time. <B>[t=]B>
<B>B>make_permanent()<B>B> Makes the session permanent - no start or end time. <B>[t=]B>
<B>B>is_unbounded()<B>B> Returns true if the session has no end time. Returns false if the session has an end time. <B>[t=]B>
<B>B>make_unbounded()<B>B> Makes the session unbounded - no end time. <B>[t=]B>
<B>repeat_add($interval, B>$duration<B>, B>$offset<B>)B> For a session that shows every day (86400, 1440m, 24h or 1d) for one hour
(3600, 60m or 1h) with an origin time from $time->start_time_ntp(). This
session then repeats that day six hours (21600, or 360m or 6h) later.



        my ( $interval, $duration ) = ( 86400, 3600 );
        my $offsets = [ 0, 21600 ]; # ARRAYREF
        $time->repeat_add($interval, $duration, $offsets);



This produces an ’r’ field of: r=1d 1h 0 6h

RFC2327 (http://www.ietf.org/rfc/rfc2327.txt), page 14 titled Times, Repeat Times and Time Zones should be consulted for clarification.

N.B. $offsets can be a single value (typically 0) regular SCALAR instead but
        then you obviously only get a single value

<B>[r=]B>

<B>repeat_delete($num)B> Delete repeat field element $num. Returns 0 on sucess, 1 if its a bad request. <B>[r=]B>
<B>B>repeat_delete_all()<B>B> Deletes any exising repeat fields. <B>[r=]B>
<B>repeat_desc($num)B> Returns repeat array element $num.



        my $repeat = $time->repeat_desc(2);



If element does not exist ’undef’ is returned, if nothing is passed to the function it defaults to the first element. The format of the ’reply’ is (all values are in seconds):



        $repeat = {
            interval  => <interval>,
            duration  => <duration>,
            offsets  => [ <offset1>, <offset2> ... ]
        };



<B>B>repeat_desc_arrayref()<B>B> Returns all the repeat elements in an ARRAYREF.
<B>B>as_string()<B>B> 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 J Humfrey, njh@cpan.org

Alexander Clouter, alex@digriz.org.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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::SDP::TIME (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.