fix time zone
Browse files- Kaggle_API.py +8 -1
Kaggle_API.py
CHANGED
|
@@ -3,6 +3,7 @@ import shutil
|
|
| 3 |
import subprocess
|
| 4 |
import json
|
| 5 |
import time
|
|
|
|
| 6 |
from datetime import datetime
|
| 7 |
from PIL import Image
|
| 8 |
|
|
@@ -158,7 +159,13 @@ class API_Connection:
|
|
| 158 |
return True, output_image
|
| 159 |
|
| 160 |
def get_current_time(self):
|
| 161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
|
| 164 |
def main():
|
|
|
|
| 3 |
import subprocess
|
| 4 |
import json
|
| 5 |
import time
|
| 6 |
+
import pytz
|
| 7 |
from datetime import datetime
|
| 8 |
from PIL import Image
|
| 9 |
|
|
|
|
| 159 |
return True, output_image
|
| 160 |
|
| 161 |
def get_current_time(self):
|
| 162 |
+
# Get the current datetime in UTC timezone
|
| 163 |
+
current_datetime_utc = datetime.now(pytz.utc)
|
| 164 |
+
# Convert UTC datetime to Egypt timezone
|
| 165 |
+
egypt_timezone = pytz.timezone("Africa/Cairo")
|
| 166 |
+
current_datetime_local = current_datetime_utc.astimezone(egypt_timezone)
|
| 167 |
+
|
| 168 |
+
return str(current_datetime_local.strftime("%Y-%m-%d %H:%M:%S %Z"))
|
| 169 |
|
| 170 |
|
| 171 |
def main():
|