<@U04S8PLJWMT> What is the documentation for the d...
# ask-ai
y
@kapa.ai What is the documentation for the day_delta function in Airbyte low code builder ?
k
The
day_delta
function in Airbyte's low-code builder is an interpolation macro that returns the datetime of now plus a specified number of days. You can also specify the output format. Here is the documentation for `day_delta`: Arguments: - `num_days`: The number of days to add to now. - `format`: (Optional) How to format the output string. Examples:
Copy code
jinja '{{ day_delta(1) }}' -> '2021-09-02T00:00:00.000000+0000' '{{ day_delta(-1) }}' -> '2021-08-31:00:00.000000+0000' '{{ day_delta(25, format='%Y-%m-%d') }}' -> '2021-09-02'
You can use this macro in your YAML files as part of Jinja expressions to dynamically calculate dates relative to the current time in UTC [Interpolation macros](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#macros).
y
@kapa.ai Instead of wworking with the current date, I have a date from a stream partition and I want to compute the day after that date {{stream_partition.start_date}}
k
A message from kapa.ai
I'm sorry, but the knowledge sources do not explicitly document how to use the
day_delta
macro with a variable date (such as
{{ stream_partition.start_date }}
) instead of the current date. All available documentation and examples for
day_delta
show it being used relative to "now" (the current date/time), not with a custom base date [Interpolation macros](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#macros). If you need to compute the day after a date from a stream partition, the documentation does not provide a direct example or confirm that
day_delta
supports a custom base date. You may need to use other macros like
format_datetime
or
str_to_datetime
in combination, but this is not explicitly covered in the provided sources.
y
@kapa.ai Ok, but is there another functionn that I can use ?
k
A message from kapa.ai
Based on the available documentation, there is no macro in Airbyte's low-code builder that directly allows you to add days to an arbitrary date (such as
{{ stream_partition.start_date }}
) in the same way that
day_delta
adds days to the current date. The macros documented—such as
day_delta
,
now_utc
,
today_utc
,
format_datetime
, and `str_to_datetime`—do not provide an example or explicit support for adding days to a user-supplied or variable date [Interpolation macros](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#macros). If you need this functionality, you may need to perform the date arithmetic outside of the macros provided, or check if future Airbyte releases introduce such a feature. As of now, the knowledge sources do not describe a macro that supports this use case.