.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 2024-02-24 "perl v5.38.2" "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(CWDate::Manip::ParseDate()\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 XMLTV time e.g. "20140412090000 +0300" to ISO format i.e. "2014\-04\-12T09:00:00.000+03:00" .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 ISO time e.g. "2014\-04\-12T09:00:00.000+03:00" to XMLTV format, i.e. "20140412090000 +0300" .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 XMLTV time e.g. "20140412090000 +0300" 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 CPAN .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. "2014\-04\-12T09:00:00.000+03:00") 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 CPAN .PP Argument is string time to convert. Optional 2nd argument: set to 1 ignore the tz offset in the calculation