File tree Expand file tree Collapse file tree
src/hiero_sdk_python/consensus Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Changelog
1+ # Changelog
22
33All notable changes to this project will be documented in this file.
44This project adheres to [ Semantic Versioning] ( https://semver.org ) .
@@ -12,6 +12,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
1212- Added CodeRabbit review instructions and path mapping for the schedule module (` src/hiero_sdk_python/schedule/ ` ) in ` .coderabbit.yaml ` (#1698 )
1313
1414### Src
15+ - Fix ` TopicInfo.__str__() ` to format ` expiration_time ` in UTC so unit tests pass in non-UTC environments. (#1800 )
1516-
1617
1718### Examples
Original file line number Diff line number Diff line change 66optional fields, and providing a readable string representation of the
77topic state.
88"""
9- from datetime import datetime
9+ from datetime import datetime , timezone
1010from typing import List , Optional
1111
1212from hiero_sdk_python .crypto .public_key import PublicKey
@@ -138,9 +138,12 @@ def __str__(self) -> str:
138138 Returns:
139139 str: A nicely formatted string representation of the topic.
140140 """
141- exp_dt : Optional [datetime ] = None
141+ exp_dt : Optional [str ] = None
142142 if self .expiration_time and hasattr (self .expiration_time , "seconds" ):
143- exp_dt = datetime .fromtimestamp (self .expiration_time .seconds )
143+ utc_dt = datetime .fromtimestamp (
144+ self .expiration_time .seconds , tz = timezone .utc
145+ )
146+ exp_dt = utc_dt .strftime ("%Y-%m-%d %H:%M:%S" )
144147
145148 running_hash_str : Optional [str ] = f"0x{ self .running_hash .hex ()} " if self .running_hash else "None"
146149
You can’t perform that action at this time.
0 commit comments