Angel Perez
06/03/2024, 10:36 PM{{ now_utc().strftime('%s') }}
in the API call I obtain the time for now in utc, that's ok, can I use a formula to reduce the time 1 or 2 months?kapa.ai
06/03/2024, 10:36 PMday_delta
macro to adjust the current time by a specific number of days. To reduce the time by 1 or 2 months, you can calculate the approximate number of days in those months and use the day_delta
macro accordingly. For example, to reduce the time by 1 month (approximately 30 days) or 2 months (approximately 60 days), you can use the following formulas: ### Reduce by 1 Month jinja '{{ day_delta(-30, format='%Y-%m-%dT%H:%M:%S') }}'
### Reduce by 2 Months jinja '{{ day_delta(-60, format='%Y-%m-%dT%H:%M:%S') }}'
Here is an example of how you can use it in your API call: jinja '{{ day_delta(-30, format='%s') }}'
This will give you the timestamp for 30 days (approximately 1 month) before the current time in UTC. For more details on the day_delta
macro, you can refer to the [Airbyte documentation](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/macros/Day%20Delta). If you need further customization or have more specific requirements, please let me know!Angel Perez
06/03/2024, 10:37 PMkapa.ai
06/03/2024, 10:37 PMkapa.ai
06/03/2024, 10:37 PMday_delta
macro in Airbyte is designed to work with days and does not directly support month or year deltas. However, you can approximate month or year deltas by calculating the number of days in those periods. For example: - 1 month can be approximated as 30 days. - 1 year can be approximated as 365 days. Here are examples of how you can use day_delta
to approximate month and year deltas: ### Reduce by 1 Month (Approx. 30 Days) jinja '{{ day_delta(-30, format='%Y-%m-%dT%H:%M:%S') }}'
### Reduce by 1 Year (Approx. 365 Days) jinja '{{ day_delta(-365, format='%Y-%m-%dT%H:%M:%S') }}'
For more details on the day_delta
macro, you can refer to the [Airbyte documentation](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/macros/Day%20Delta). If you need more precise control over month or year calculations, you might need to handle this logic outside of the day_delta
macro, possibly using a more advanced scripting or programming approach.