Hello everyone, I’ma facing an issue while using a DATETIME var as a dashboard variable.
The var type is DATETIME so like this : YYYY-M-DD HH:MinMin:SecSec and I select it as a dashboard variable which end up as a really long number instead of date format.
I don’t know yet how to make it have a date format.
Thanks for this useful info ! Infortunately it doesn’t seem to return anything…I tried different ways yet nothing worked
I tried these :
→ from_unixtime(${date}) so using the dashboard variable hat was returning the number list
→ from_unixtime(number) directly using the number returned by the variable date
→ from_unixtime(${date}, ‘%Y.%m.%d.%H.%i.%s’) specifying the format
I was about to tell you that, well done yes it’s better now !!
There still is an issue…I have a dashboard variable “date” which returns something like “1729251541” that I use in another dashboard variable “DATE” that looks like this
→ FROM_UNIXTIME(SUBSTR( 1729251541000, 1, 10), ‘%Y-%m-%d %H:%i:%s’
This way i can only return one value for DATE which is’nt my goal, and if I mix the two variable to make one it returns 2 values that are incorrect (year 1970 and only 2).
I get why you’re saying this however when trying this in my database the line FROM_UNIXTIME(SUBSTR( 1729251541000, 1, 10), ‘%Y-%m-%d %H:%i:%s’) works perfectly !
The time data I use on Grafana in the dashoard variable “date” is write like this 2024-10-18 13:39:01 in my database but when I select it as a dashboard variable it becomes epochs that is my main issue I guess.
And doing substrings on epochs because it is actually 3 numbers longer than the regular writing.