diff --git a/CHANGELOG.md b/CHANGELOG.md index e53205666f..d08c53ad36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed extraction of recursive exceptions https://github.com/Textualize/rich/pull/3772 - Fixed padding applied to Syntax https://github.com/Textualize/rich/pull/3782 - Fixed `Panel` title missing the panel background style https://github.com/Textualize/rich/issues/3569 +- Fixed RichHandler log time rendering by converting naive datetimes to timezone-aware to ensure correct display https://github.com/Textualize/rich/issues/3877 ### Added diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4b04786b9c..ba64328523 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -94,3 +94,4 @@ The following people have contributed to the development of Rich: - [Jonathan Helmus](https://github.com/jjhelmus) - [Brandon Capener](https://github.com/bcapener) - [Alex Zheng](https://github.com/alexzheng111) +- [Ammar Abdelhalem](https://github.com/ammarabdelhalem) diff --git a/rich/logging.py b/rich/logging.py index c3e7a5f670..31e4c8f296 100644 --- a/rich/logging.py +++ b/rich/logging.py @@ -224,7 +224,7 @@ def render( path = Path(record.pathname).name level = self.get_level_text(record) time_format = None if self.formatter is None else self.formatter.datefmt - log_time = datetime.fromtimestamp(record.created) + log_time = datetime.fromtimestamp(record.created).astimezone() log_renderable = self._log_render( self.console,