AnsweredAssumed Answered

Time String to consistently pull interpolated values from last day of each month?

Question asked by MattSidor on May 3, 2018
Latest reply on May 4, 2018 by vkaufmann

I need to pull interpolated values at 1-month intervals from the last day of each month...specifically the last second of the last day of each month (e.g. 11:59:59 PM on January 31).


I have found a query that works if the start month is January (a month with 31 days), but doesn't work if the start month is February (29 days) or April (30 days). It seems to only work with start months that have 31 days.


The startTime and endTime strings are the first day of the month, plus 1 month, minus 1 second. Before percent-encoding, this string looks like (for January 2015): "2015-01-01 +1mo-1s"


Example 1mo-interval query that starts in January 2015 and ends in December 2017:[some-web-id]/interpolated?startTime=2015-01-01%20%2B1mo-1s&endTime=2017-12-01%20%2B1mo-1s&interval=1mo


(%20 = space, %2B = plus sign)

Like I said, this works correctly for startTime in January, but if the startTime is February or April, many of the timestamps are off by 1-2 days.


Is there a different Time String I should use instead to consistently pull the interpolated values on the last second of the last day of each month? Or perhaps a different kind of query altogether?

(Time String reference docs: