Commit graph

2 commits

Author SHA1 Message Date
Jorge Vallecillo
94522b7c10
Fix typos () 2020-09-28 14:33:24 -04:00
Sam Doran
c4f442ed5a
facts - fix incorrect time for some date_time_facts ()
The iso8601_micro and iso8601 facts incorrectly called now.utcnow(), resulting
in a new timestamp at the time it was called, not a conversion of the previously
stored timestamp.

Correct this by capturing the UTC timestamp once then calculating the local
time using the UTC offset of the current system.

* Use time.time() for getting the current time
* Convert from that stored epoch timestamp to local and UTC times
* Used existing timestamp for epoch time
* Add unit tests that validate the formate of the return value rather than an exact value since mocking time and timezone is non-trivial
2020-07-30 11:39:58 -04:00