Open source Enterprise Grafana Cloud

Time formats

When working with time-based data, you need to tell the Infinity data source how to parse timestamp values from your data. The parsing method depends on which parser you’re using.

Column types for time data

When defining columns, you can choose from three time-related types:

Column typeDescriptionUse when
TimeStandard date/time parsingYour data uses readable date formats (ISO 8601, RFC formats)
Time (UNIX ms)Unix epoch in millisecondsYour data uses millisecond timestamps (e.g., 1262304000000)
Time (UNIX s)Unix epoch in secondsYour data uses second timestamps (e.g., 1262304000)

Frontend parser time formats

When using the Frontend parser, timestamp fields are parsed using JavaScript’s built-in Date constructor. The following formats are automatically recognized:

text
2017
2017-02
2017-03
2017/04
2017/05/23
2017-06-25T12:10:00Z
July 12, 2017 03:24:00
2017/08/23 10:30
2017/09/23 10:30:20
2017-10-23 10:30:20
Thu Nov 23 2017 10:30:20 GMT+0000 (Greenwich Mean Time)
Sat, 23 Dec 2017 10:30:20 GMT
01/29/2018

For more details on supported formats, refer to the MDN Date documentation.

Backend parser time formats

When using the Backend parser (JSONata or JQ), you can specify a custom time format using Go’s time layout syntax. Select from predefined formats or enter a custom format.

Predefined formats

The following formats are available in the Time Format drop-down:

LabelFormat pattern
Auto(automatic detection)
Default ISO2006-01-02T15:04:05Z07:00
YYYY-MM-DD2006-01-02
YYYY/MM/DD2006/01/02
YYYY / MM / DD2006 / 01 / 02
YYYYMMDD20060102
YYYY-MM2006-01
YYYY/MM2006/01
YYYYMM200601
YYYY2006
YYYY/MM/DD HH:mm2006/01/02 15:04
YYYY/MM/DD HH:mm:ss2006/01/02 15:04:05
ANSICMon Jan _2 15:04:05 2006
UnixDateMon Jan _2 15:04:05 MST 2006
RubyDateMon Jan 02 15:04:05 -0700 2006
RFC82202 Jan 06 15:04 MST
RFC822Z02 Jan 06 15:04 -0700
RFC850Monday, 02-Jan-06 15:04:05 MST
RFC1123Mon, 02 Jan 2006 15:04:05 MST
RFC1123ZMon, 02 Jan 2006 15:04:05 -0700
RFC33392006-01-02T15:04:05Z07:00
RFC3339Nano2006-01-02T15:04:05.999999999Z07:00
Kitchen3:04PM
StampJan _2 15:04:05

Custom formats

You can enter a custom format pattern using Go’s reference time layout. The reference time is:

text
Mon Jan 2 15:04:05 MST 2006

Each component maps to a specific value:

ComponentReference valueDescription
Year2006Four-digit year
Month01 or JanNumeric or abbreviated
Day02 or _2Zero-padded or space-padded
Hour (24h)1524-hour format
Hour (12h)0312-hour format
Minute04Minutes
Second05Seconds
AM/PMPMAM/PM indicator
TimezoneMST or -0700Timezone abbreviation or offset

Example custom formats:

  • 02/01/2006 — DD/MM/YYYY (European format)
  • 01-02-2006 03:04 PM — MM-DD-YYYY with 12-hour time
  • 2006.01.02 — YYYY.MM.DD with dots

Unix epoch timestamps

For data that uses Unix epoch timestamps, select the appropriate column type:

Milliseconds (UNIX ms)

For timestamps in milliseconds since January 1, 1970:

csv
timestamp,value
1262304000000,200
1293840000000,201

Select Time (UNIX ms) as the column type.

Seconds (UNIX s)

For timestamps in seconds since January 1, 1970:

csv
timestamp,value
1262304000,200
1293840000,201

Select Time (UNIX s) as the column type.

Troubleshoot time parsing

If your timestamps aren’t parsing correctly:

  1. Check the column type — Ensure you’ve selected the correct type (Time, UNIX ms, or UNIX s)
  2. Verify the format — For backend parser, ensure your format pattern matches your data exactly
  3. Test with Auto — Try the Auto format option first to see if automatic detection works
  4. Check for quotes — Some CSV data may have quoted date strings that need special handling
  5. Timezone issues — If times appear shifted, check that your format includes timezone information