##// END OF EJS Templates
utils: stop using datetime.utcfromtimestamp() deprecated in Python 3.12...
Mads Kiilerich -
r51645:faccec1e stable
parent child Browse files
Show More
@@ -567,8 +567,10 b' class mapfile(dict):'
567 567
568 568 def makedatetimestamp(t):
569 569 """Like dateutil.makedate() but for time t instead of current time"""
570 delta = datetime.datetime.utcfromtimestamp(
570 tz = round(
571 571 t
572 ) - datetime.datetime.fromtimestamp(t)
573 tz = delta.days * 86400 + delta.seconds
572 - datetime.datetime.fromtimestamp(t)
573 .replace(tzinfo=datetime.timezone.utc)
574 .timestamp()
575 )
574 576 return t, tz
@@ -83,10 +83,14 b' def makedate(timestamp=None):'
83 83 raise error.InputError(
84 84 _(b"negative timestamp: %d") % timestamp, hint=hint
85 85 )
86 delta = datetime.datetime.utcfromtimestamp(
86 tz = round(
87 87 timestamp
88 ) - datetime.datetime.fromtimestamp(timestamp)
89 tz = delta.days * 86400 + delta.seconds
88 - datetime.datetime.fromtimestamp(
89 timestamp,
90 )
91 .replace(tzinfo=datetime.timezone.utc)
92 .timestamp()
93 )
90 94 return timestamp, tz
91 95
92 96
General Comments 0
You need to be logged in to leave comments. Login now