We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24d436c commit 5d645a2Copy full SHA for 5d645a2
src/commoncode/filetype.py
@@ -7,7 +7,7 @@
7
#
8
9
import os
10
-from datetime import datetime
+from datetime import datetime, timezone
11
12
from commoncode.system import on_posix
13
from commoncode.functional import memoize
@@ -164,7 +164,10 @@ def get_last_modified_date(location):
164
yyyymmdd = ''
165
if is_file(location):
166
utc_date = datetime.isoformat(
167
- datetime.utcfromtimestamp(os.path.getmtime(location))
+ datetime.fromtimestamp(
168
+ os.path.getmtime(location),
169
+ tz=timezone.utc,
170
+ )
171
)
172
yyyymmdd = utc_date[:10]
173
return yyyymmdd
0 commit comments