Time format & localtime #251
Replies: 3 comments
-
I found 1 place which is the history page it's under httpd_site.py -> HistoryPage -> render_GET -> formatted_timestamp I've tested this locally in a different program without any issue... |
Beta Was this translation helpful? Give feedback.
-
Hi @JStyle21, It's a good idea (to be able to trivially change the time format). I've labelled it as a feature request for now since as you have noted there isn't a clean place to do it currently. Do you mind sharing the code you tried? Since the python3 port is almost ready, we won't be adding more code right now. But we can line this request up |
Beta Was this translation helpful? Give feedback.
-
Hi @jayjb At first i've tried to convert UTC to Local but it didn't work but then i actually solved this issue by converting all the UTC functions such as As for the conversion function, i took it from stackoverflow, here is the code: from datetime import datetime
import time
def datetime_from_utc_to_local(utc_datetime):
now_timestamp = time.time()
offset = datetime.fromtimestamp(now_timestamp) - datetime.utcfromtimestamp(now_timestamp)
return utc_datetime + offset |
Beta Was this translation helpful? Give feedback.
-
Hi,
Is it possible to change the time format and use something other than UTC?
I've found a TIME_FORMAT variable in the email alerts but it's not being used, i've also tried to change the time in 4-5 different files and location but non of them seem to impact the result and there are so many other occurrences, where is the correct place to change it so it's reflected in the emails and dashboard?
Beta Was this translation helpful? Give feedback.
All reactions