Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

NRQL showing wrong dates

nrql

#1

Hi all

I am trying to look at a few apps transactions over a couple of hour period where we had some slowness to work out which of the apps was having trouble.

SELECT average(duration) FROM Transaction WHERE appName in(‘APP1’, 'APP2, ‘APP3’) since ‘2018-08-19 22:00:00’ UNTIL ‘2018-08-19 23:00:00’ FACET name LIMIT 20 TIMESERIES

This is showing a graph with the top 20 transactions with a few nice peaks that we can investigate.
The problem is, the dates I specified are not what I get in the results!
I am seeing on the X axis the times are from 06:00PM to 07:00, and when I hover over the graph the latest time recorded is 18:59 to 19:00!

I’m guessing I need to format the dates in the request maybe?


#2


#3

Hi, @brett.howells: You probably need to specify a time zone, either as part of your time literals (e.g., ‘2018-08-19 22:00:00 PDT’), or using the WITH TIMEZONE clause.


#4

@philweber At this time, you can’t use the timezone (e.g. PDT, EST, etc) in the time literal, you have to use the offset. The example you gave above would be correctly formatted as '2018-08-19 22:00:00 -07:00'

@brett.howells I wanted to expand a bit on the WITH TIMEZONE clause to make sure it’s clear. This clause only affects the time range queried on, and has no effect on the time zone displayed in the browser. Events in Insights are timestamped with epoch time, so all queries will be run against UTC time unless otherwise specified. You can also use the epoch time in your queries, like: SINCE 1535734621. However, Insights will always show results in the system time of the user running the query.


#5

Im confused!

Are you saying that I can query based on the epoch time, but what is displayed is the current time on my browser?


#6

That’s correct. It’s a feature so that you are not confused with the time shift.

There are a few browser plugins that allow you to spoof your timezone.


#7

That’s exactly right. Queries are run on the timestamp, but results are displayed in the current time on your browser.