XMLTV::Date - Man Page

Date parsing routines for the xmltv package

See Also

Date::Manip

parse_date()

Wrapper for Date::Manip::ParseDate() 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.

Argument is a single string.

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”

Argument is string time to convert.

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”

Argument is string time to convert.

time_xmltv_to_epoch()

Converts a XMLTV time  e.g. “20140412090000 +0300” to seconds since the epoch

(uses POSIX::mktime rather than Date::Manip to avoid issues with the latter)

Alternatively you could use DateTime::Format::XMLTV on CPAN

Argument is string time to convert. Optional 2nd argument: set to 1 ignore the tz offset in the calculation

time_iso_to_epoch()

Converts an iso time (e.g. “2014-04-12T09:00:00.000+03:00”) to epoch time

(uses POSIX::mktime rather than Date::Manip to avoid issues with the latter)

Alternatively you could use DateTime::Format::XMLTV on CPAN

Argument is string time to convert. Optional 2nd argument: set to 1 ignore the tz offset in the calculation

Info

2021-02-07 perl v5.32.1 User Contributed Perl Documentation