[ ] question about the decisions made in the repository
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?LazyRfc3339UtcTime returns server local time as utc time in RFC3339 format.
If the current behavior is a bug, please provide the steps to reproduce and if possible a screenshots and logs of the problem. If you can, show us your code.
import datetime
from cherrypy._cplogging import LazyRfc3339UtcTime
# Both datetime are out by timezone offset
print(LazyRfc3339UtcTime())
print(f"{datetime.datetime.utcnow().isoformat()}Z")
What is the expected behavior?
LazyRfc3339UtcTime should return utc time string in RFC3339 format.
What is the motivation / use case for changing the behavior?
Log timestamp should display the correct timestamp of an event.
Please tell us about your environment:
cheroot: 9.0.0
CherryPy: 18.8.0
Python 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32
OS: Windows 10
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, e.g. stackoverflow, gitter, etc.)
Suggestions on bug fix:
Replace now() with utcnow()
class LazyRfc3339UtcTime(object):
def __str__(self):
"""Return utcnow() in RFC3339 UTC Format."""
return f"{datetime.datetime.utcnow().isoformat('T')}Z"
I'm submitting a ...
Do you want to request a feature or report a bug? Report a bug
What is the current behavior?
LazyRfc3339UtcTime
returns server local time as utc time in RFC3339 format.If the current behavior is a bug, please provide the steps to reproduce and if possible a screenshots and logs of the problem. If you can, show us your code.
What is the expected behavior? LazyRfc3339UtcTime should return utc time string in RFC3339 format.
What is the motivation / use case for changing the behavior? Log timestamp should display the correct timestamp of an event.
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, e.g. stackoverflow, gitter, etc.)
Suggestions on bug fix: Replace
now()
withutcnow()