How to convert a big number (in seconds) to Years Months Days format

  • What Grafana version and what operating system are you using?
    9.4 / CentOS7

  • What are you trying to achieve?
    I am using snmp-exporter to poll the system uptime and then send data to Prometheus.
    For example, the data polled is 339818971 seconds. I’d like to have it displayed something like 10 years 9 months 20 days…

  • How are you trying to achieve it?
    The standard unit options have duration (d hh:mm:ss) but this doesn’t suit for my purpose.

  • What happened?
    Couldn’t find a viable way of doing it.

  • What did you expect to happen?
    I’d like to have it displayed something like 10 years 9 months 20 days…

Your assistance is highly appreciated.

Welcome

What visualization are you using for this?

Thanks yosiasz.
I am using Stat visualization

1 Like

Thanks yosiasz.
I am using Stat visualization

1 Like

Any one has any thoughts?