diff -r fa2eca7423f3 -r faccec1edc2c mercurial/utils/dateutil.py --- a/mercurial/utils/dateutil.py Thu Jul 06 16:04:36 2023 +0200 +++ b/mercurial/utils/dateutil.py Tue Jun 27 13:51:50 2023 +0200 @@ -83,10 +83,14 @@ raise error.InputError( _(b"negative timestamp: %d") % timestamp, hint=hint ) - delta = datetime.datetime.utcfromtimestamp( + tz = round( timestamp - ) - datetime.datetime.fromtimestamp(timestamp) - tz = delta.days * 86400 + delta.seconds + - datetime.datetime.fromtimestamp( + timestamp, + ) + .replace(tzinfo=datetime.timezone.utc) + .timestamp() + ) return timestamp, tz