Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -6,10 +6,22 @@ import random
|
|
6 |
USERNAME = "openfree"
|
7 |
|
8 |
def format_timestamp(timestamp):
|
9 |
-
if timestamp:
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
return dt.strftime('%Y-%m-%d %H:%M')
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
def should_exclude_space(space_name):
|
15 |
"""ํน์ ์คํ์ด์ค๋ฅผ ์ ์ธํ๋ ํํฐ ํจ์"""
|
|
|
6 |
USERNAME = "openfree"
|
7 |
|
8 |
def format_timestamp(timestamp):
|
9 |
+
if not timestamp:
|
10 |
+
return 'N/A'
|
11 |
+
try:
|
12 |
+
# ๋ฌธ์์ด์ธ ๊ฒฝ์ฐ
|
13 |
+
if isinstance(timestamp, str):
|
14 |
+
dt = datetime.fromisoformat(timestamp.replace('Z', '+00:00'))
|
15 |
+
# ์ ์(๋ฐ๋ฆฌ์ด)์ธ ๊ฒฝ์ฐ
|
16 |
+
elif isinstance(timestamp, (int, float)):
|
17 |
+
dt = datetime.fromtimestamp(timestamp / 1000) # ๋ฐ๋ฆฌ์ด๋ฅผ ์ด๋ก ๋ณํ
|
18 |
+
else:
|
19 |
+
return 'N/A'
|
20 |
return dt.strftime('%Y-%m-%d %H:%M')
|
21 |
+
except Exception as e:
|
22 |
+
print(f"Timestamp conversion error: {str(e)} for timestamp: {timestamp}")
|
23 |
+
return 'N/A'
|
24 |
+
|
25 |
|
26 |
def should_exclude_space(space_name):
|
27 |
"""ํน์ ์คํ์ด์ค๋ฅผ ์ ์ธํ๋ ํํฐ ํจ์"""
|