We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

Traffic time specification


Only the following time formats are supported. Other values such as "today" or "last week", which can be observed by playing with the Insights GUI URLs, are unsupported by the APIs.

There are four ways to specify the start and stop time in the /traffic requests and filters:

  1. As seconds, measured in Unix time.
    If specified as a positive integer, the time point is interpreted as the number of seconds elapsed since the Unix epoch. 
    For example, the value 1400078399 can be used to specify Wed, 14 May 2014 14:39:59 GMT.
     

  2. As a second offset from the current time.
    If specified as a non-positive integer, the time point is interpreted as the number of seconds before the instant when the request is received by the API server.
    For example, the value -3600 can be used to specify one hour ago, while -86400 can be used to specify 24 hours ago, and 0 can be used to specify right now.
     

  3. As a custom unit offset from the current time.
    If specified as string starting with "-" and ending with a suffix letter, the time point can also denote the number of seconds (s), minutes (m), hours (h), days (d), weeks (w) or months (M) or years (y) before the instant when the request is received by the API server.
    For example, "-30m" can be used to specify 30 minutes ago, while "-1M" can be used to specify one month ago.
     

  4. As a ISO 8601 date and time in extended format.
    Otherwise, if specified as a string, the time point can denote a ISO 8601 timestamp.
    For example, "2014-05-14T14:39:59.000Z" can be used to specify Wed, 14 May 2014 14:39:59 GMT, while "2014-05-14T14:39:59.0+0200" can be used to specify  Wed, 14 May 2014 14:39:59 in Oslo.
     



Last updated: