Re: tv_grab_sd_json: ISO8601
Robert Eden <[email protected]>
| Newsgroups | gmane.comp.tv.xmltv.devel |
|---|---|
| Message-ID | <[email protected]> |
On 6/5/2016 2:10 PM, Kevin Groeneveld wrote: > On Sun, Jun 5, 2016 at 3:31 AM, <[email protected] > <mailto:[email protected]>> wrote: > > Is there any particular reason for using ISO8601 in this grabber? > > > Because this is pretty much the first Perl program I have ever written > and I didn't know anything about parsing dates in perl? The SD JSON > data uses ISO8601 date formats so I probably googled "perl ISO8601" > and DataTime::Format::ISO8601 was the first hit that seemed like the > right thing to do. > > DateTime::Format::ISO8601 has a lot more (compile-time) > dependencies than DateTime::Format::DateParse and is therefore > harder to install on older machines. :-( > > If you don't need the extra power of ISO8601 then wouldn't > DateParse do the job? > > > I don't even know what extra power the DateTime::Format::ISO8601 > module has compared to DateTime::Format::DateParse. Looking at the > docs very quickly didn't really clue me in either. > > I tried replacing the three occurrences of > "DateTime::Format::ISO8601->parse_datetime" with > "DateTime::Format::DateParse->parse_datetime". This caused the > previously-shown date to be off in some cases. I assume this could > probably be fixed without too much effort. > > What do others think? Would it be better to use > DateTime::Format::DateParse if possible? Other grabbers already use DateTime, so not introducing another dependency is a good idea. If your test caused previously-shown to shift, it's probably a timezone issue.. storing the Gacenote provided date as a midnight date-time which then shifts to a different date with a timezone. Hopefully, you can just treat it as a date.. if not, pick noon so timezone shifts should be less of a problem (but of course only output the date, not your made-up time) Robert ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ xmltv-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xmltv-devel