Murilo Belarmino
10/23/2024, 2:31 PMuser
10/23/2024, 2:31 PMformat_datetime
macro in your YAML configuration. This macro allows you to convert a datetime string from one format to another. Here's how you can set it up: 1. For the start date: yaml start_datetime: datetime: "{{ config['start_date'] }}" datetime_format: "%Y-%m-%dT%H:%M:%SZ"
2. Then, when you need to use this date in the API request, you can format it like this: yaml start_time_option: field_name: "from-date" inject_into: "request_parameter" format: "{{ format_datetime(stream_state['start_datetime'], '%Y-%m-%d') }}"
3. Similarly for the end date (assuming you're using the current date): yaml end_time_option: field_name: "to-date" inject_into: "request_parameter" format: "{{ format_datetime(now_utc(), '%Y-%m-%d') }}"
This approach uses the format_datetime
macro to convert the datetime from the ISO 8601 format (%Y-%m-%dT%H:%M:%SZ) to the format required by your API (%Y-%m-%d). You can find more information about the format_datetime
macro in the [Airbyte documentation on interpolation macros](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/macros/Format%20Datetime). Remember to adjust the field names and injection method according to your specific API requirements. [Airbyte Documentation: Format Datetime](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/macros/Format%20Datetime)Murilo Belarmino
10/23/2024, 2:33 PMuser
10/23/2024, 2:34 PMdatetime_format
in the manifest.yaml file to accommodate the ISO 8601 format [GitHub Issue #41054](https://github.com/airbytehq/airbyte/issues/41054). If these solutions don't resolve your issue, you may need to provide more context about the specific connector you're using and its configuration. Consider opening an issue on the Airbyte GitHub repository with detailed information about your setup and the full error message.