mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 22:31:55 +00:00
Remove use of deprecated datetime.utcnow()
To fix warnings below: ``` <python-input-1>:1: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). ```
This commit is contained in:
@@ -57,13 +57,7 @@ class Patcher:
|
||||
|
||||
def patch(self):
|
||||
self.file.header.file_name.name = "Rabbit"
|
||||
self.file.header.file_name.time_stamp = (
|
||||
datetime.datetime.utcnow()
|
||||
.replace(tzinfo=datetime.timezone.utc)
|
||||
.astimezone()
|
||||
.replace(microsecond=0)
|
||||
.isoformat()
|
||||
)
|
||||
self.file.header.file_name.time_stamp = datetime.datetime.now().astimezone().replace(microsecond=0).isoformat()
|
||||
self.file.header.file_name.preprocessor_version = "Rabbit"
|
||||
self.file.header.file_name.originating_system = "Rabbit"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user