Skip to content

Commit 3f4f14b

Browse files
TobiasKaisereugmes
authored andcommitted
Fix datetime.utcnow() deprecation warning
1 parent 222ce8b commit 3f4f14b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

gdsii/library.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"""
2525
from __future__ import absolute_import
2626
from . import exceptions, record, structure, tags, _records
27-
from datetime import datetime
27+
from datetime import datetime, timezone
2828

2929
_HEADER = _records.SimpleRecord('version', tags.HEADER)
3030
_BGNLIB = _records.TimestampsRecord('mod_time', 'acc_time', tags.BGNLIB)
@@ -77,8 +77,8 @@ def __init__(self, version, name, physical_unit, logical_unit, mod_time=None,
7777
self.name = name
7878
self.physical_unit = physical_unit
7979
self.logical_unit = logical_unit
80-
self.mod_time = mod_time if mod_time is not None else datetime.utcnow()
81-
self.acc_time = acc_time if acc_time is not None else datetime.utcnow()
80+
self.mod_time = mod_time if mod_time is not None else datetime.now(timezone.utc)
81+
self.acc_time = acc_time if acc_time is not None else datetime.now(timezone.utc)
8282
self._init_optional()
8383

8484
def _init_optional(self):

0 commit comments

Comments
 (0)