Update developing_plugins.rst (#72305)
##### SUMMARY ansible_date_time returns utc time. datetime.utcnow() rather than datetime.now() ##### ISSUE TYPE - Docs Pull Request +label: docsite_pr
This commit is contained in:
parent
570aed0913
commit
1937dd5e9c
1 changed files with 1 additions and 1 deletions
|
@ -130,7 +130,7 @@ For example, if you wanted to check the time difference between your Ansible con
|
|||
|
||||
if remote_date:
|
||||
remote_date_obj = datetime.strptime(remote_date, '%Y-%m-%dT%H:%M:%SZ')
|
||||
time_delta = datetime.now() - remote_date_obj
|
||||
time_delta = datetime.utcnow() - remote_date_obj
|
||||
ret['delta_seconds'] = time_delta.seconds
|
||||
ret['delta_days'] = time_delta.days
|
||||
ret['delta_microseconds'] = time_delta.microseconds
|
||||
|
|
Loading…
Reference in a new issue