Kodi Community Forum

Full Version: EPG date premiered wrong...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So the listitem.premiered date is off by a day in my epg. After digging in, I realized the reason is that I am in the pacific timezone (UTC -7) and the listitem.premiered code is adjusting for the timezone difference.

As the date a tv show premiered is coded as a date only (no time - which means it is likely being set as 00:00:00) when transfered from the backend (in this case tvheadend)...the date is displayed incorrectly.

So here's the question. Should the localized date code be removed from the listitem.premiered in GUIInfoManager.cpp or do we expect that the pvr backend addons should compensate for the timezone offset before sending the data to kodi?

My opinion is tv date data is already localized, so kodi should not be compensating a time different for this data. I didn't post this as a bug as it may have been intended this way - but I wanted to try to sort out which side should fix. :-)
Imo this is just a stupid bug in guiinfomanger.

LISTITEM_PREMIERED is implemented the way, that It first gets the localized date (and time, pvr gets the value as utc from the backend and does not cut off the time, btw) from the epgtag and then it localizes it a second time. I think it is correct to first obtain the date and time as utc and then to convert it to a localized date string.

https://github.com/xbmc/xbmc/blob/master....cpp#L9626

I will test this tonight and open a PR with a fix, then.
I believe I figured this out. My xmltv grabber was not adding the timezone offset to the xmltv generated file. I couldn't see this in tvheadend as it does not display the original airdate info. Once I added the TZ offset to the xmltv file - kodi displayed LISTITEM_PREMIERED correctly.

Thanks for the feedback!

Separate question...is there a way to have $INFO[ListItem.Premiered] display a short date? Looks like it is hard coded to long date instead of having the option to add custom layout for example (ddd mmm d, YYYY)

It actually looks like only the system time and date can be customized...seems like it would be best to have that option on most time date displays.