Similar to 365d-ago for historical, how do we specify relative time for future?

  • 3 March 2022
  • 4 replies

Userlevel 3

For the Retrieve data points API and a few other API’s that allow date range input, we are able to specify a string where, “The format is N[timeunit]-ago where timeunit is w,d,h,m,s.”  This is able to specify a time in the past.  I am now trying to specify end as “-365d-ago” to set a date 365 days in the future, but this is giving an error.

Is there another syntax available for specifying future dates?




Best answer by Thomas Sjølshagen 10 March 2022, 14:16

View original

4 replies

We do not currently support relative timestamps in the future - the pattern from the doc is the only one we support (though it also accepts `ms` for milliseconds). However, as you might know, these endpoints also accept Unix timestamps in milliseconds - for example, noon UTC on March 10, 2022 would be 1646913600000. So you could compute the timestamp of your desired future time and supply that instead.

Userlevel 4

Additionally, we have a feature defined to expand short notation for data point retrieval to support the same notation for the past as well (i.e. negative short notation values). It’s in the Product Management queue for consideration in 2H2022, but we do not have an explicit schedule, nor a committed plan for delivery right now.

@Ben Brandt You could add the idea that Thomas mentioned above to the Ideation Module to see if it gets upvotes from others as well, which would increase the likelihood of us prioritizing it.

Userlevel 3

@AasmundEldhuset As requested, I have added the product idea here: