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

Beraldo Leal bleal at redhat.com
Tue Oct 29 23:43:42 UTC 2019


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.

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/avocado-devel/attachments/20191029/30b555ad/attachment.htm>


More information about the Avocado-devel mailing list