Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dirsigler/eb745a809d9fd58304a25fedc33c5ea0 to your computer and use it in GitHub Desktop.
Save dirsigler/eb745a809d9fd58304a25fedc33c5ea0 to your computer and use it in GitHub Desktop.
Transforming Unix/Epoch Timstamps to Unreadable Time in Grafana

Display Unix Timestamp as Human-Readable Date in Grafana

Last updated: 2025-05-08
Applies to: Grafana 9+

If you've exported a time value in Prometheus and brought it into Grafana you've probably seen something like this and wondered whether you'd accidentally stepped into a time machine:

image

This will appear after you've chosen the value as date/time, ISO:

image

In order to fix this you want to multiply your value by 1000 to convert it from epoch or unix time into human readable:

image

Choose multiply by scalar > 1,000:

image

Now, it should look like this:

image

Formatting The Timestamp

If you don't like the way in which the timestamp is presented and want to clean it up a little on your dashboard, you can set a custom unit type and choose your own value.

If you want to use words in the timestamp like I did below then put it in square brackets

time:DD/MM/YY [at] HH:mm

Paste the custom unit type into the unit value and the ability to create it will come up in the UI:

image

Now your custom time value has displayed, you're no longer stuck in 1970 and it looks pretty good!

image

Fixed Timestamp

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment