[Avocado-devel] NRunner: decide on a "wire-format" for time/dates

Amador Pahim amador at pahim.org
Wed Oct 30 09:05:46 UTC 2019


On Wed, Oct 30, 2019 at 12:43 AM Beraldo Leal <bleal at redhat.com> wrote:
>
> Hi Amador, my comments below:
>
> On Tue, Oct 29, 2019 at 5:16 PM Amador Pahim <amador at pahim.org> wrote:
> > About precision (mentioned in the trello card), no matter the format
> > you pick, it all starts with an epoch on a float with the maximum
> > precision provided by the platform (time.time()). So one cannot get
> > more precise than that, afaik.
>
> I agree.
>
> > [nrunner]
> > # datetime: epoch or asctime (defaults to asctime)
> > datetime = asctime
> > # datefmt: asctime formatters using strftime (defaults to ISO-8601 format)
> > datefmt = '%Y-%m-%d %H:%M:%S'
> >
> > "epoch" would give users time.time().
> > "asctime" would give users time.strftime(datefmt, time.localtime(time.time()))
>
> My only concern here is to have a datetime stored like "2019-12-01 09:02:52",
> *without* the timezone information. This will cause ambiguity.

But you can respect the timezone AND avoid ambiguity with "2019-12-01
09:02:52+03:00".
As a user, if the timezone is a problem, I would set up my system to
GMT. If parsing is a problem, I'd setup avocado to "epoch".
What I fail to see is the use case for ISO-8601 in UTC.

>
> Daylight saving time rules change from time to time. To correctly calculate the difference from
> hourA to hourB, we would need to lookup at all historical variations in daylight saving time rules.
>
> Regards,
> --
> Beraldo Leal
> Senior Software Engineer, Virtualization Team
> Red Hat




More information about the Avocado-devel mailing list