To convert a Unix timestamp into a date when adding fields from records in the Connector Builder, you can use the DeclarativeStream configuration as a reference. This configuration was mentioned in a forum post where a user was handling Unix timestamps with the Low-Code CDK. Here’s the relevant configuration: yaml incremental_sync: type: DatetimeBasedCursor cursor_field: "created" datetime_format: "%s" cursor_granularity: "PT1S" start_datetime: datetime: "{{ config['start_date'] }}" datetime_format: "%Y-%m-%d %H:%M:%S" end_datetime: datetime: "{{ today_utc() }}" datetime_format: "%Y-%m-%d" step: "P1W" start_time_option: field_name: "created_after" inject_into: "request_parameter" end_time_option: field_name: "created_before" inject_into: "request_parameter"
In this configuration, the datetime_format
is set to "%s"
for the cursor_field
, which is the Unix timestamp. This tells the connector to interpret the Unix timestamp as a date. Please note that this configuration is for the incremental sync feature of the connector. If you want to add fields from records, you might need to use a similar approach but within the context of the “add” transformation as described in the Adding fields documentation. Unfortunately, the provided extracts do not contain specific information on how to add a field that converts a Unix timestamp to a date. For more detailed guidance, you may want to refer to the Airbyte documentation.