.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .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. \*(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- .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" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Date 3pm" .TH Date 3pm "2023-02-24" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XMLTV::Date \- Date parsing routines for the xmltv package .SH "SEE ALSO" .IX Header "SEE ALSO" Date::Manip .ie n .SH """parse_date()""" .el .SH "\f(CWparse_date()\fP" .IX Header "parse_date()" Wrapper for \f(CW\*(C`Date::Manip::ParseDate()\*(C'\fR that does two things: firstly, if the year is not specified it chooses between last year, this year and next year depending on which date would be closest to now. (If only one of those dates is valid, for example because day-of-week is specified, then the valid one is chosen; if the time can only be parsed without adding an explicit year then that is chosen.) Secondly, an exception is thrown if the date cannot be parsed. .PP Argument is a single string. .ie n .SH """time_xmltv_to_iso()""" .el .SH "\f(CWtime_xmltv_to_iso()\fP" .IX Header "time_xmltv_to_iso()" Converts a \s-1XMLTV\s0 time e.g. \*(L"20140412090000 +0300\*(R" to \s-1ISO\s0 format i.e. \*(L"2014\-04\-12T09:00:00.000+03:00\*(R" .PP Argument is string time to convert. .ie n .SH """time_iso_to_xmltv()""" .el .SH "\f(CWtime_iso_to_xmltv()\fP" .IX Header "time_iso_to_xmltv()" Converts an \s-1ISO\s0 time e.g. \*(L"2014\-04\-12T09:00:00.000+03:00\*(R" to \s-1XMLTV\s0 format, i.e. \*(L"20140412090000 +0300\*(R" .PP Argument is string time to convert. .ie n .SH """time_xmltv_to_epoch()""" .el .SH "\f(CWtime_xmltv_to_epoch()\fP" .IX Header "time_xmltv_to_epoch()" Converts a \s-1XMLTV\s0 time e.g. \*(L"20140412090000 +0300\*(R" to seconds since the epoch .PP (uses POSIX::mktime rather than Date::Manip to avoid issues with the latter) .PP Alternatively you could use DateTime::Format::XMLTV on \s-1CPAN\s0 .PP Argument is string time to convert. Optional 2nd argument: set to 1 ignore the tz offset in the calculation .ie n .SH """time_iso_to_epoch()""" .el .SH "\f(CWtime_iso_to_epoch()\fP" .IX Header "time_iso_to_epoch()" Converts an iso time (e.g. \*(L"2014\-04\-12T09:00:00.000+03:00\*(R") to epoch time .PP (uses POSIX::mktime rather than Date::Manip to avoid issues with the latter) .PP Alternatively you could use DateTime::Format::XMLTV on \s-1CPAN\s0 .PP Argument is string time to convert. Optional 2nd argument: set to 1 ignore the tz offset in the calculation