mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
Fix crash in module_utils.datetime.fromtimestamp() (#11206)
Fix crash in module_utils.datetime.fromtimestamp().
(cherry picked from commit cbf13ab6c9)
This commit is contained in:
parent
a2042c9b93
commit
43e709b9f2
2 changed files with 5 additions and 2 deletions
3
changelogs/fragments/11206-datetime.yml
Normal file
3
changelogs/fragments/11206-datetime.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
bugfixes:
|
||||
- "datetime module utils - fix bug in ``fromtimestamp()`` that caused the function to crash.
|
||||
This function is not used in community.general (https://github.com/ansible-collections/community.general/pull/11206)."
|
||||
|
|
@ -22,8 +22,8 @@ def ensure_timezone_info(value):
|
|||
|
||||
def fromtimestamp(value):
|
||||
if _USE_TIMEZONE:
|
||||
return _datetime.fromtimestamp(value, tz=_datetime.timezone.utc)
|
||||
return _datetime.utcfromtimestamp(value)
|
||||
return _datetime.datetime.fromtimestamp(value, tz=_datetime.timezone.utc)
|
||||
return _datetime.datetime.utcfromtimestamp(value)
|
||||
|
||||
|
||||
def now():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue