Merge pull request #12865 from AUTOMATIC1111/another-convert-to-system-time-zone

extension update time, convert to system time zone
This commit is contained in:
AUTOMATIC1111 2023-08-30 11:00:29 +03:00 committed by GitHub
commit 0ff8b8fb54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import json
import os
import threading
import time
from datetime import datetime
from datetime import datetime, timezone
import git
@ -442,7 +442,7 @@ sort_ordering = [
def get_date(info: dict, key):
try:
return datetime.strptime(info.get(key), "%Y-%m-%dT%H:%M:%SZ").strftime("%Y-%m-%d")
return datetime.strptime(info.get(key), "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc).astimezone().strftime("%Y-%m-%d")
except (ValueError, TypeError):
return ''