Discussion:
[Xmltv-devel] About the format of start and end times in XMLTV
Sorin Ovidiu
2011-01-27 21:04:55 UTC
Permalink
Hello everybody,

I hope you will help me clarify one thing about the start and stop
attributes of the element <programme/>. I think the answer is quite simple,
but I want to be sure I'm right.

In the DTD for XMLTV it says:

All dates and times in this DTD follow the same format, loosely based
on ISO 8601. They can be 'YYYYMMDDhhmmss' or some initial
substring, for example if you only know the year and month you can
have 'YYYYMM'. You can also append a timezone to the end; if no
explicit timezone is given, UTC is assumed. Examples:
'200007281733 BST', '200209', '19880523083000 +0300'. (BST == +0100.)

This means that the 'YYYYMMDDhhmmss' part always represents the UTC time?
And, implicitly, if you want to see when the programme will be aired (or
will stop), then you have to add to the first part (UTC) the timezone?. And
if there is no timezone, then it means that the programme is stopped/aired
at the 'YYYYMMDDhhmmss' UTC time?

Thank you very much,
Ovidiu
Karl Dietz
2011-01-27 21:42:02 UTC
Permalink
Hi,
Post by Sorin Ovidiu
have 'YYYYMM'. You can also append a timezone to the end; if no
you will run into problems if you cut start/stop down to month
granularity because no ones has tested their software with such data.
(besides it most likely doesn't make sense :)
Post by Sorin Ovidiu
'200007281733 BST', '200209', '19880523083000 +0300'. (BST == +0100.)
you should avoid time zones like BST like the pest, as they are not
unique! Just go for time offsets like +0100 or UTC like Z when writing
timestamps.
Post by Sorin Ovidiu
This means that the 'YYYYMMDDhhmmss' part always represents the UTC time?
No. It is in UTC if it has no offset given. (explicit UTC "Z" or
"+0000" or "-0000" or implicit due to missing information)
Post by Sorin Ovidiu
And, implicitly, if you want to see when the programme will be aired (or
will stop), then you have to add to the first part (UTC) the timezone?. And
if there is no timezone, then it means that the programme is stopped/aired
at the 'YYYYMMDDhhmmss' UTC time?
let's just make some example...

program start time is 3 o'clock in the afternoon on new year.
a) 201101011500, without any information (floating time) it must be
assumed as UTC. Some data sources express local time like that, but
it will lead to lots of wrong time stamps.
b) 201101011500 Z, this is explicit UTC
c) 201101011500 +0100, this is 15:00 in localtime (which is one hour
ahead of UTC) and 14:00 in UTC

To sum it up, if you generate xmltv you really should be explicit about
the offset to UTC or simply write UTC. If you parse xmltv you should
intepret floating time as implicit UTC, but be prepared that some guide
sources will break...

Regards,
Karl

Loading...