Skip to content

Commit fd00af1

Browse files
cliffhallclaude
andcommitted
fix(time): neutral wording for a skipped local time
A gap is not always a DST change (Asia/Pyongyang on 2018-05-04 moved its standard offset), so the error now says "skipped by a clock change". Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 7bcb802 commit fd00af1

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎src/time/src/mcp_server_time/server.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,13 @@ def convert_time(
102102
tzinfo=source_timezone,
103103
)
104104

105-
# A wall-clock time skipped by a DST jump (e.g. 02:30 on a
105+
# A wall-clock time skipped by a clock change (e.g. 02:30 on a DST
106106
# spring-forward day) does not survive a round trip through UTC.
107107
round_trip = datetime.fromtimestamp(source_time.timestamp(), source_timezone)
108108
if round_trip.replace(tzinfo=None) != source_time.replace(tzinfo=None):
109109
raise ValueError(
110110
f"Invalid time: {time_str} does not exist in {source_tz} on "
111-
f"{source_time.date().isoformat()} (skipped by a daylight "
112-
"saving time change)"
111+
f"{source_time.date().isoformat()} (skipped by a clock change)"
113112
)
114113

115114
target_time = source_time.astimezone(target_timezone)

‎src/time/tests/test_protocol.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ async def test_convert_time_into_a_nonexistent_local_time() -> None:
726726
)
727727
assert result == handler_error(
728728
"Invalid time: 02:30 does not exist in America/New_York on 2024-03-10 "
729-
"(skipped by a daylight saving time change)"
729+
"(skipped by a clock change)"
730730
)
731731

732732

0 commit comments

Comments
 (0)