Unix epoch time is a system for describing instants in time. It is shown in the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, January 1, 1970.
If a metric returns points in time in unix epoch time, it will likely show up in milliseconds. You can use easy SQLite functions called "date" and "datetime" to change it into a more relevant date and time. Here’s how:
On the Edit Metric page, go to Data Settings. Scroll down and check the box next to Advanced Options.
In the SQL query box that opens up, type:
SELECT date(columnName, ‘unixepoch’) as Date
This will turn it into a normal date field. If you want the field to include the hours and minutes as well, use the
datetime(columnName, ‘unixepoch’) as Date command instead.
Then press Connect.
Note: Some APIs will return the number of seconds since the epoch, not milliseconds. If this is the case, use the string
date(columnName/1000, ‘unixepoch’) as Date . This will convert the value into milliseconds and allow SQLite to interpret the date correctly.
Questions? Email us at firstname.lastname@example.org or chat in on the site.