Grafana change date format - tip of the day

Since Grafana version 7.20 (Grafana addon updated 2020-09-23) it is now possible to localize the date format in a env.
read more here about the options
Default is US i.e. MM/DD HH:mm

Update your grafana configuration to DD/MM

plugins: []
env_vars:
  - name: GF_DATE_FORMATS_INTERVAL_HOUR
    value: 'DD/MM HH:mm'
  - name: GF_DATE_FORMATS_INTERVAL_DAY
    value: DD/MM
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem

From


To

*Updated typo

5 Likes

Thank you!

I was messing around with that but could not get it to work. I had …INTERVALS_…

Did you try the experimental browser setting?

Yeah, I tried, thought that would be best but couldn´t get the syntax correct :confused:
Settled for now with the fixed setting.

1 Like

I’m struggling to get this to work at all. I have the following config, but I’m still getting American dates…

plugins: []
env_vars:
  - name: GF_DATE_FORMATS_FULL_DATE
    value: 'MMM Do, YYYY @ hh:mm:ss a'
  - name: GF_DATE_FORMATS_INTERVAL_SECOND
    value: 'hh:mm:ss a'
  - name: GF_DATE_FORMATS_INTERVAL_MINUTE
    value: 'hh:mm a'
  - name: GF_DATE_FORMATS_INTERVAL_HOUR
    value: 'MMM DD hh:mm a'
  - name: GF_DATE_FORMATS_INTERVAL_DAY
    value: 'DD/MM'
  - name: GF_DATE_FORMATS_INTERVAL_MONTH
    value: YYYY-MM
  - name: GF_DATE_FORMATS_INTERVAL_YEAR
    value: YYYY
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem

I have cleared the cache and saving the config restarts the addon. Any thoughts?

Ah, I’m on version 5.2.3 of the addon due to that damned issue with the Supervisor saying my install is unhealthy which I don’t know how to fix. So I can’t update, and that version of the addon is still on Grafana 7.1. So no dice for me right now.

Hi, I’m trying to get my Grafana to use DD/MM date format as described above.

I’m unclear about where this code is entered.

plugins: []
env_vars:
  - name: GF_DATE_FORMATS_INTERVAL_HOUR
    value: 'DD/MM HH:mm'
  - name: GF_DATE_FORMATS_INTERVAL_DAY
    value: DD/MM
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem

I tried to add it to my Configurations file but the configuration check tells me it is not valid:

My Grafana version is v8.1.2
Home Assistant is 2021.10.1

Any tips on how I can make this amendment to the default US date format work?

Thanks!

You add it in the addon configuration page:

Thanks but where is that?

I see no menu like that in Home Assistant.

OK, I think I found it. Will see I go.

OK, now that I’ve found that, when I enter in the code I get an invalid YAML error and of course I can’t save the settings (probably for good reason / just as well).

Any clues on what might be wrong?

I’m unfamiliar with what this code means/does, so I’m just scratching around in the dark.

Remove the square brackets after env_vars. That signifies an empty list when you have nothing in the option.

1 Like

Thanks! That did the trick.

I now have dates for normal people :slight_smile:

No offence to my American friends intended of course.

@tom_l to the rescue as always, you are a kind soul.

Regards

Ha! Thanks. I’m not sure everyone here would agree. I have been known to get cranky at times.

Well everyone gets a bit “RTFM-cranky” when answering the same questions over and over. Especially when one have such deep knowledge in HA as you.

At the end of day, I’ve learnt a from the forum heros on here. And you are one of them.

Hats off.

1 Like

I’m having the same problem as wattmatters in that my Grafana keeps defaulting to American MM/DD rather than British format of DD/MM. I have changed the Configuration YAML to:

certfile: fullchain.pem
env_vars:

  • name: GF_DATE_FORMAT_INTERVAL_HOUR
    value: DD/MM HH:mm
  • name: GF_DATE_FORMATS_INTERVAL_DAY
    value: DD/MM
    keyfile: privkey.pem
    plugins: []
    ssl: true

Any thoughts anyone?

  • List item

You are missing an “S” at the end of FORMATS. Should be:

env_vars:
  - name: GF_DATE_FORMATS_INTERVAL_HOUR
    value: DD/MM HH:mm
  - name: GF_DATE_FORMATS_INTERVAL_DAY
    value: DD/MM

Thanks tom_I

Blimey, isn’t something obvious when it is pointed out! I’ve just corrected it as you advised and it’s worked perfectly. Thank you. It’s appreciated.

maybe someone will find it useful too:

env_vars:
  - name: GF_DATE_FORMATS_INTERVAL_HOUR
    value: DD/MM HH:mm
  - name: GF_DATE_FORMATS_INTERVAL_DAY
    value: DD/MM
  - name: GF_DATE_FORMATS_FULL_DATE
    value: DD/MM/YYYY HH:mm:ss
1 Like

Thanks !
this is exactly what I was looking for

+1 thanks.

But how do you tell Grafana which format to use for a specific panel?