Discussion:
[Xmltv-devel] tv_grab_il and time zones
Or Cohen
2010-08-10 19:52:18 UTC
Permalink
Hello all,

A small perl question.

I want to close that annoying bug (#2967298) which caused by (lazy me)
implementing a work around to find out what is the current time-zone in
Israel.
Basically, the programmes start times that the grabber is scraping are
matching the current time-zone in Israel (which is logical). I need to put
this time-zone in back into the programme details.

My problem is, how do I know what is the current time-zone in Israel (i.e.
the TZ site is displaying)?
strftime('%z') returns the time zone, but this would cause the programme
listing in a desired client (mythtv, xbmc, etc.) not display the programme
at the correct date/time for machines that are configured with a time zone
other then an Israeli one.

There must be something I'm missing here.
I saw DateTime package allows one to start an object with a desired
time-zone other than what is configured in the env., for example:
use DateTime;
$dt = DateTime->new(year => $show_year, month => $show_month, day =>
$show_day, time_zone => 'Asia/Jerusalem');
$tz = $dt->strftime('%z');

But do I really need to use this package just to get the time-zone in
Israel?
Or Cohen
2010-08-11 07:00:58 UTC
Permalink
Find attached a draft patch for your consideration.
Well, I can't argue. That does seem a lot better then the current :)
Thanks, I'll validate with it and update the CVS.

I'm not a perl expert, do you know if DateTime is a standard package? Should
we add a note in the README for using tv_grab_il with DateTime?
Nick Morrott
2010-08-12 17:58:14 UTC
Permalink
Post by Or Cohen
Find attached a draft patch for your consideration.
Well, I can't argue. That does seem a lot better then the current :)
Thanks, I'll validate with it and update the CVS.
I'm not a perl expert, do you know if DateTime is a standard package? Should
we add a note in the README for using tv_grab_il with DateTime?
Great to see tv_grab_il validating :)

As DateTime is not a core module [1], it should be added to
Makefile.PL as a prerequisite for tv_grab_il (note that tv_grab_dk_dr
also uses it).

Cheers,
Nick

[1] http://perldoc.perl.org/index-modules-D.html
--
Nick Morrott

MythTV Official wiki: http://mythtv.org/wiki/
MythTV users list archive: http://www.gossamer-threads.com/lists/mythtv/users

"An investment in knowledge always pays the best interest." - Benjamin Franklin
Loading...