WebGrab+Plus - utc http://www.webgrabplus.com/tags/utc en Times, time-zones and DST corrections. http://www.webgrabplus.com/content/times-time-zones-and-dst-corrections <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p><strong>The two time-zones:</strong></p> <p>• The first thing to realize is that there are two time-zones involved in the times in your final EPG, each with its own DST rules:<br /> - the time-zone for which the times of the guide is provided (the 'source' time-zone) and<br /> - the time-zone of the user (the 'target' time-zone).<br /> In the majority of cases these two are equal, but that doesn't change the fact that there are two to consider.<br /> • In principle, the guide times must be corrected for UTC offset and DST changes for both these two time-zones: The first correction, the one for the 'source' time-zone, is done by WG++ and the second, for the 'target' (should be done) by some piece of software at the viewers side, probably the PVR xmltv importer.</p> <p><strong>The wrong way:</strong></p> <p>• In earlier versions of WG++ (before version 1.1.1.53) the program was unable to identify the 'source' time-zone correctly, the only info available about it was the time-zone value in the SiteIni. But that value was limited to just an UTC offset, not the proper time-zone_id and the DST rules for that. (The reason for that limitation lies in the fact that timezone_id's are not standardised among the varies computer platforms, Windows, Linux, OSX, for which WG++ should work) Therefore the DST correction that WG++ applied for the 'source' time-zone was done with the DST rules of the 'target' time-zone. Consequently, the DST changeover dates applied for the source time-zone were the DST changeover dates of the target time-zone. Although wrong in principle, it is only a problem if these DST changeover dates of source and target time-zones are different, which is possible but unlikely. (no problem if the user lives in the 'source' time-zone).<br /> • Situations when this goes wrong? Examples:<br /> - If a user in Europe wants to use a guide from the US (they have different DST changeover dates), or any other mismatch of DST changeover dates. Or,<br /> - if the source time-zone has no DST rules (no DST in that zone) and the user lives in a time-zone with DST rules. Or the opposite. Or,<br /> - if the source time-zone is UTC (the guide times are not in any particular time-zone, just plain UTC or GMT). Any user living in a time-zone with DST rules will run into problems because WG++ will apply the DST rules of the viewer to the xmltv startime which was meant to be UTC without any DST rule.<br /> • The problems explained above can be 'corrected', temporary, by either changing the time-zone value in the siteini or by using the small utility xmltv_time_correct, (available @ <a href="http://www.webgrabplus.com/sites/default/files/download/utility/xmltv_time_correct/xmltv_time_correct.zip">http://www.webgrabplus.com/sites/default/files/download/utility/xmltv_ti...</a> on the download page) for the period of the mismatch of the DST rules.</p> <p><strong>The right way:</strong></p> <p>• To solve these problems, later versions of WG++ include an integrated international 'cross platform' time-zone database that correctly identifies the source time-zone and the DST rule for that. </p> <p>With that, WG++ doesn't use the target time-zone any more. The two above mentioned DST corrections are completely separated, WG++ for the source, and the PVR's xmltv importer at the user end for the target.</p> <p><strong>How to interpret the times in the xmltv file created by WG++? :</strong></p> <p>• By definition, the XMLTV TIMES ARE IN UTC (GMT) !!</p> <p>• The xmltv specification allows several formats for that and WG++ uses the one with an UTC offset, format yearmonthdayhourminutesecond +/-utcoffset or yyyyMMddhhmmss +/-hhmm. The first part of that is (in most cases) the date and time presented in the tvguide of the source site, the second part is the actual offset of that with respect to UTC. E.g start="20140602141500 -0500" represents a local time at the source of 2014/06/02 14:15 (or 2:15pm) in a time-zone that is 5 hours behind (-) UTC. So, because the result is UTC by definition, this is 2014/06/02 19:15 UTC .<br /> • The eventual DST correction for the source time-zone is done by WG++ through changing the UTC offset with the effect that the result always remains the correct UTC source time for the start of this tv-program.</p> <p><strong>What about the start-time for the viewer in his time-zone? :</strong></p> <p>• The calculation, to be carried out by some piece of program at the viewer's side, probably the xmltv importer of the PVR program, must simply correct for the actual local UTC offset (corrected for DST if necessary). As example, a few cases:<br /> - Suppose the viewer is in the same time-zone as that of the source, which is quite normal. Then the start-time value of 2014/06/02 19:15 UTC will be corrected back to 2014/06/02 14:15.<br /> - Suppose the viewer's actual UTC offset is +8:00 (Singapore or there about), then this start-time is corrected to 2014/06/03 3:15 (early morning, next day)</p> <p><strong>What if the times in your EPG appear to be wrong?</strong></p> <p>• Make sure you have the latest WG++ version that has the integrated time-zone database.<br /> • Check if the time-zone in the SiteIni you are using is the correct one for the epg source site.<br /> • Check if the times in the xmltv file created by WG++ are indeed as described above (local epg source time and UTC offset)<br /> • Make sure your computer is set to the correct time-zone of your location, enable DST and check the time and date setting<br /> • Try to figure out if the xmltv importer of the PVR you are using works as described above (correct for the actual local UTC offset). (Some importers have problems with xmltv files containing different UTC offsets, reading only the first one found and assuming this to be the only one). In that case a small utility WG2MP can help.<br /> <a href="http://webgrabplus.com/sites/default/files/download/utility/WG2MP/WG2MP.zip">http://webgrabplus.com/sites/default/files/download/utility/WG2MP/WG2MP.zip</a><br /> • Some other importers use the UTC offset in the xmltv rather than the target timezone offset, in that case there is only : the final resort, temporary offset the guide times by using <a href="http://www.webgrabplus.com/sites/default/files/download/utility/xmltv_time_correct/xmltv_time_correct.zip">http://www.webgrabplus.com/sites/default/files/download/utility/xmltv_ti...</a></p> </div></div></div><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/tags/xmltv" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">xmltv</a></div><div class="field-item odd" rel="dc:subject"><a href="/tags/time" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">time</a></div><div class="field-item even" rel="dc:subject"><a href="/tags/timezone" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">timezone</a></div><div class="field-item odd" rel="dc:subject"><a href="/tags/dst" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">dst</a></div><div class="field-item even" rel="dc:subject"><a href="/tags/offset" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">offset</a></div><div class="field-item odd" rel="dc:subject"><a href="/tags/utc" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">utc</a></div></div></div> Sun, 01 Jun 2014 20:41:59 +0000 WGMaker 680 at http://www.webgrabplus.com http://www.webgrabplus.com/content/times-time-zones-and-dst-corrections#comments