You are here

SiteINI modifying - Calculate start times to adapt to GMT/UTC problem

8 posts / 0 new
Last post
rapidiptv
Offline
rapidiptv's picture
Joined: 5 years
Last seen: 1 month
SiteINI modifying - Calculate start times to adapt to GMT/UTC problem

Hello,

I wanted to adapt all my EPG data with GMT/UTC so instead of adding offset for channels in my config file (and thus making my EPG bigger) it would be better for me to edit SiteINI files. I could edit some of them but some other would get problematic.

For example if I add this line to nos.pt.ini (First show starts at 2016/10/31 00:18 for example):
index_start.modify {calculate(format=time,HH:mm)|01:00 -}

The calculation happens but the date won't change. (The result of the above calculation's result for my example is 2016/10/31 23:18 but the correct calculation is 2016/10/30 23:18)

 

Here's the debug info:

[  Debug ] Debugging information SiteIni
[  Debug ] Element:  INDEX_START
[  Debug ] Modify
[  Debug ]      command & arguments : calculate(debug)(format=time,HH:mm)
[  Debug ]      Expression-1            : 01:00 -
[  Debug ]      Element value before operation:
[  Debug ] 00:18
[  Debug ]      Calculate 01:00 -
[  Debug ]      Result = 23:18
[  Debug ]      Element value after operation:
[  Debug ] 23:18
[  Debug ] Converted to:
31-10-2016 23:18:00
rapidiptv
Offline
rapidiptv's picture
Joined: 5 years
Last seen: 1 month

A very careful and considerate answer! Big thanks!

digiboy72
Offline
Joined: 5 years
Last seen: 2 years
Blackbear199 wrote:

options to do what you want that i know of...

1 - merge-xmltv-utc.ini

   its posted on the forums somewhere.i created(its a modified merge-xmltv.ini) that .....

Hi, i have used this merge-xmltv-utc.ini ,but is it possible to put the code to each site.ini, so in all xml files timezone will be UTC?

With merge-xmltv-utc.ini all url are http://www.merge-xmltv-utc.ini, not original one and i have to run all sites twice.

 

kroken
Offline
Donator
Joined: 4 years
Last seen: 1 month
Blackbear199 wrote:

 

2 use wg2mp.exe

its a utility that takes the time offset of a program and adjust the start/stop time to your local time.(the timeoffset,+0100 example is removed from your guide.xml).it was created for media portal which also does not use the timeoffset in the guide.xml.

there are a few tricks to use this...ad i said above it adjust the start/stop time to Your Local time(or whatever the timezone is one the device running webgrab).so if by change your local time is UTC then you all set but more than likely it isn't.

what i do(on linux) is in a script change the TZ= to UTC,then run wg2mp.exe,then change the TZ= back to correct pc timezone.

example..

#__Set timezone to UTC___
TZ='Atlantic/Reykjavik'; export TZ

#__Adjust To UTC____
mono WG2MP.exe wg_guide.xml wg_guide_temp.xml
sed -r "s/start=\"([0-9]{14})\" stop=\"([0-9]{14})\"/start=\"\1 +0000\" stop=\"\2 +0000\"/g" < wg_guide_temp.xml > wg_guide.xml

#__Set timezone to Local___
TZ='America/Moncton'; export TZ

as you can see i have a sed command there also,i use it to add the +0000 offset to the start/stop time as wg2mp.exe removes them.

example

original guide.xml entry..

<programme start="20161031193000 +1100" stop="20161031204000 +1100" channel="9Gem">

after wg2mp.exe(with TZ= set to UTC)...

<programme start="20161031083000" stop="20161031094000" channel="9Gem">

after sed command...

<programme start="20161031083000 +0000" stop="20161031094000 +0000" channel="9Gem">

 

 

 

Just curious if this will work if i grab from different .ini with different timezones? Lets say i grab one from +0100 and another one +0300. Will the script correct both to UTC then?

kroken
Offline
Donator
Joined: 4 years
Last seen: 1 month

Yes i just tried it and it didnt work, i was trying with +0100 and +0300 and used WG2MP, i set the timezone to UTC and then run the script and add the +00000 but seems like WG2MP is not adjusting both to UTC.

I know you have a merge-ini-utc but then i will have to run webgrab twice, first grab the data and then merge it. 

Isnt there a better an easier solution?

Cheers

kroken
Offline
Donator
Joined: 4 years
Last seen: 1 month
Blackbear199 wrote:

all i can say is your doing something wrong,it should work.

 

 

Youre right, i think i fucked it up will try again!

jorges4lu2
Offline
Joined: 2 years
Last seen: 2 months

Hi,

Could anyone share with me the "merge-xmltv-utc.ini" file? I've searched all over the forum and found nothing.

Thanks in advance

mat8861
Offline
WG++ Team memberDonator
Joined: 6 years
Last seen: 3 hours
Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl