mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-19 21:00:14 +08:00
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:
parent
87a083d1b2
commit
1ac11b3dae
@ -2,7 +2,7 @@ import json
|
|||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
from datetime import datetime
|
from datetime import datetime, timezone
|
||||||
|
|
||||||
import git
|
import git
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ sort_ordering = [
|
|||||||
|
|
||||||
def get_date(info: dict, key):
|
def get_date(info: dict, key):
|
||||||
try:
|
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):
|
except (ValueError, TypeError):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user