Unix time to UK Date Time

Apologies for the question. I have googled and looked around the forum before asking. Very new to grafana and have a question relating to visual display for datetime. There are numerous things scattered here and there but nothing concrete enough for me to try.

Just for a test I have a pi4 logging mysql temperatures in part of the building.

logdatetime datetime NOT NULL COMMENT ‘Date Time Logged’);

The unit is datetime format

I would like if possible for the date on graph haver to display a more UK centric format. This being dd-mm-yyy 00:00:00

If someone could offer some assistance it would be gratefully received. Although the test case is working it would be good to have a correct format for graph interrogation.

Edit 30/03/2021 Sorry for the other non title related information. It may however helps others that are new to the grafana concepts.

It’s possible from Grafana 7.2 by changing server wide settings config file. How you do that will depend on your platform but for me on Ubuntu Linux for example:

vi /etc/grafana/grafana.ini

ADD TO END (assuming not already present in .ini file):

full_date = DD/MM/YYYY HH:mm:ss

Restart Grafana instance.

1 Like

Many thanks codlord. That had the desired effect. Now I have to work out how to display pre defined time periods. I get the selection tool top right. Just trying to figure out how you go about utilising the same data point on multiple panels but display different time frames. For instance a month / year / last year etc. Great piece of software, lot to learn but enjoying it.

Time range controls | Grafana Labs should
help you with that - look at the first table of examples…


Thanks for that pooh.

I have tried couple of examples.

The only thing that confuses me is when you go into the edit facility it always shows the last date range you selected for a panel.

For instance edit previous seven days and it shows previous year from other panel. I would have thought the panel view would have remembered the time range from each panel?. I could have possibly grabbed the wrong end of the stick here but it seems strange.

In actual fact I spoke too soon. It appears that after a refresh I have 7 days on both panels now. So I’m a bit confused on how you retain different date / time periods independent of panels.

The time range is applied on a dashboard level, not a panel level. So any changes to the time range (even while editing a single panel) will apply to all panels in the dashboard.

Luckily, you can apply a per-panel override, which I think is what you’re after: Time range controls | Grafana Labs

1 Like

I would just like say a big thanks to all on this thread. It is certainly turning into more a common pitfalls for newb text.

Ok svetb I will look into the time range options many thanks…

Heres is another good one.

I have a room temperature recording to mysql every minute.

I have set up a basic time based display for 24 hours.

As you can see when selecting the last value it does not reflect the correct temperature. The last 16.2 reading was

Also when selecting the last hours it shows a blank page. Again I’m probably being incredibly green here. Is it not a case that grafana queries the mysql on demand by refresh or by time period?.

Changing it to hourly shows

Noting that the value when taking above is

I fully appreciate this thread has not stuck to the beaten track but these are fundamentals I need to grasp in order to build on.

UPDATE post writing of above Ok I was a dummy. :smile:

I will leave this up for posterity and to help others. Of course this was wood from the trees moment and I hadn’t applied a group by value.

having done so I get the accurate values. Homer moment been a heavy week, Soz.