Dynamic Date Range
  • 1 Minute to read
  • Dark

Dynamic Date Range

  • Dark

Dataddo is able to define a dynamic date range relative to the current date.

When is The Dynamic Range Needed?

Imagine a situation where date-related params must be defined as part of the API call.


If such a call is automated, the extracted dataset will always be the same, which is presumably not ideal. Both startDate and endDate params should be dynamically generated. This can be done using dynamic date range expressions such as follows.

How Does it Work?


The expression is enclosed in double curly brackets consists of three parts:

  1. The number at the start of expression 1m1. This represents the number of units (on this occasion, months) to go back from the current date and defines the start of the range. 0 represents the current value.

  2. Unit definition: d = day, m = month, w = week

  3. The last number sets the end of the range. 0 marks today, 1 marks yesterday, and so on. There is a rule that the first digit has to always be larger than the second one.






Today in ISO 8601 notation (2022-12-31)




Yesterday and today


This month


Last month


Ninety days ago till yesterday


Last week


This week starting from monday


This year


Last year


Yesterday in Unix seconds

API Call with 'yesterday' Date Range


API Call with 'this month' Date Range


Date String Formatting

The date string is by default output as YYYY-MM-DD string (e.g. 2019-12-31). Unfortunately, not all APIs follow ISO 8601 standards. In such cases, it is possible to use a date string formating.

Custom Formatting Examples







How to Change Date Range in Ad-hoc Data Load

Another case is that selecting date range in the Ad-hoc data load panel is not possible. When this occurs, there is still a way to get your historical data. This process is a bit more advanced but feasible following this guide.

Was this article helpful?

What's Next