.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::SDP::Time 3" .TH Net::SDP::Time 3 "2008-01-13" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Net::SDP::Time \- Time Description in an SDP file .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& my $time = $sdp->new_time_desc(); .Ve .PP .Vb 1 \& print "Session started: ".$time->start_time(); .Ve .PP .Vb 1 \& $time->make_permanent(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class represents a single Time Description (t=) in an \s-1SDP\s0 file. When parsing an \s-1SDP\s0 file, Net::SDP will create an instance of Net::SDP::Time for each time description. New time descriptions can be created using the \&\fInew_time_desc()\fR method in Net::SDP. .Sh "\s-1METHODS\s0" .IX Subsection "METHODS" .IP "\fB\f(BIstart_time_ntp()\fB\fR" 4 .IX Item "start_time_ntp()" Get or Set the Start Time as decimal representation of Network Time Protocol (\s-1NTP\s0) time values in seconds. \fB[t=]\fR .Sp Example: .Sp .Vb 2 \& $start_ntp = $time->start_time_ntp(); \& $time->start_time_ntp( 3303564104 ); .Ve .IP "\fB\f(BIend_time_ntp()\fB\fR" 4 .IX Item "end_time_ntp()" Get or Set the End Time as decimal representation of Network Time Protocol (\s-1NTP\s0) time values in seconds. \fB[t=]\fR .Sp Example: .Sp .Vb 2 \& $end_ntp = $time->end_time_ntp(); \& $time->end_time_ntp( 3303567704 ); .Ve .IP "\fB\f(BIstart_time_unix()\fB\fR" 4 .IX Item "start_time_unix()" Get or Set the Start Time as decimal Unix time stamp. \fB[t=]\fR .Sp Example: .Sp .Vb 2 \& $start = $time->start_time_unix(); \& $time->start_time_unix( time() ); .Ve .IP "\fB\f(BIend_time_unix()\fB\fR" 4 .IX Item "end_time_unix()" Get or Set the End Time as decimal Unix time stamp. \fB[t=]\fR .Sp Example: .Sp .Vb 2 \& $end = $time->end_time_unix(); \& $time->end_time_unix( time()+3600 ); .Ve .IP "\fB\f(BIstart_time()\fB\fR" 4 .IX Item "start_time()" Get a textual representation of the Start Time. \fB[t=]\fR .Sp Example: .Sp .Vb 1 \& print "Session starts: ".$time->start_time(); .Ve .IP "\fB\f(BIend_time()\fB\fR" 4 .IX Item "end_time()" Get a textual representation of the End Time. \fB[t=]\fR .Sp Example: .Sp .Vb 1 \& print "Session ends: ".$time->end_time(); .Ve .IP "\fB\f(BIis_permanent()\fB\fR" 4 .IX Item "is_permanent()" Returns true if the session is permanent. Returns false if the session has a start or end time. \fB[t=]\fR .IP "\fB\f(BImake_permanent()\fB\fR" 4 .IX Item "make_permanent()" Makes the session permanent \- no start or end time. \fB[t=]\fR .IP "\fB\f(BIis_unbounded()\fB\fR" 4 .IX Item "is_unbounded()" Returns true if the session has no end time. Returns false if the session has an end time. \fB[t=]\fR .IP "\fB\f(BImake_unbounded()\fB\fR" 4 .IX Item "make_unbounded()" Makes the session unbounded \- no end time. \fB[t=]\fR .ie n .IP "\fBrepeat_add($interval, \fB$duration\fB, \f(BI$offset\fB)\fR" 4 .el .IP "\fBrepeat_add($interval, \f(CB$duration\fB, \f(CB$offset\fB)\fR" 4 .IX Item "repeat_add($interval, $duration, $offset)" For a session that shows every day (86400, 1440m, 24h or 1d) for one hour (3600, 60m or 1h) with an origin time from \f(CW$time\fR\->\fIstart_time_ntp()\fR. This session then repeats that day six hours (21600, or 360m or 6h) later. .Sp .Vb 3 \& my ( $interval, $duration ) = ( 86400, 3600 ); \& my $offsets = [ 0, 21600 ]; # ARRAYREF \& $time->repeat_add($interval, $duration, $offsets); .Ve .Sp This produces an 'r' field of: r=1d 1h 0 6h .Sp \&\s-1RFC2327\s0 (http://www.ietf.org/rfc/rfc2327.txt), page 14 titled \&\*(L"Times, Repeat Times and Time Zones\*(R" should be consulted for clarification. .Sp N.B. \f(CW$offsets\fR can be a single value (typically 0) regular \s-1SCALAR\s0 instead but then you obviously only get a single value .Sp \&\fB[r=]\fR .IP "\fBrepeat_delete($num)\fR" 4 .IX Item "repeat_delete($num)" Delete repeat field element \f(CW$num\fR. Returns 0 on sucess, 1 if its a bad request. \fB[r=]\fR .IP "\fB\f(BIrepeat_delete_all()\fB\fR" 4 .IX Item "repeat_delete_all()" Deletes any exising repeat fields. \fB[r=]\fR .IP "\fBrepeat_desc($num)\fR" 4 .IX Item "repeat_desc($num)" Returns repeat array element \f(CW$num\fR. .Sp .Vb 1 \& my $repeat = $time->repeat_desc(2); .Ve .Sp 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): .Sp .Vb 5 \& $repeat = { \& interval => , \& duration => , \& offsets => [ , ... ] \& }; .Ve .IP "\fB\f(BIrepeat_desc_arrayref()\fB\fR" 4 .IX Item "repeat_desc_arrayref()" Returns all the repeat elements in an \s-1ARRAYREF\s0. .IP "\fB\f(BIas_string()\fB\fR" 4 .IX Item "as_string()" Returns a textual representation/summary of the time description. .Sp Example: .Sp .Vb 1 \& 'Tue Aug 2 11:13:28 2004 until Tue Aug 2 13:15:00 2004' .Ve .SH "AUTHOR" .IX Header "AUTHOR" Nicholas J Humfrey, njh@cpan.org .PP Alexander Clouter, alex@digriz.org.uk .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2004 University of Southampton .PP 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.