Low code CDK: Datetime format documentation (#27149)
* add format documentation * fix * improve
This commit is contained in:
@@ -580,10 +580,40 @@ definitions:
|
||||
- "{{ config['record_cursor'] }}"
|
||||
datetime_format:
|
||||
title: Cursor Field Datetime Format
|
||||
description: The datetime format of the Cursor Field.
|
||||
description: |
|
||||
The datetime format of the Cursor Field. Use placeholders starting with "%" to describe the format the API is using. The following placeholders are available:
|
||||
* **%s**: Epoch unix timestamp - `1686218963`
|
||||
* **%a**: Weekday (abbreviated) - `Sun`
|
||||
* **%A**: Weekday (full) - `Sunday`
|
||||
* **%w**: Weekday (decimal) - `0` (Sunday), `6` (Saturday)
|
||||
* **%d**: Day of the month (zero-padded) - `01`, `02`, ..., `31`
|
||||
* **%b**: Month (abbreviated) - `Jan`
|
||||
* **%B**: Month (full) - `January`
|
||||
* **%m**: Month (zero-padded) - `01`, `02`, ..., `12`
|
||||
* **%y**: Year (without century, zero-padded) - `00`, `01`, ..., `99`
|
||||
* **%Y**: Year (with century) - `0001`, `0002`, ..., `9999`
|
||||
* **%H**: Hour (24-hour, zero-padded) - `00`, `01`, ..., `23`
|
||||
* **%I**: Hour (12-hour, zero-padded) - `01`, `02`, ..., `12`
|
||||
* **%p**: AM/PM indicator
|
||||
* **%M**: Minute (zero-padded) - `00`, `01`, ..., `59`
|
||||
* **%S**: Second (zero-padded) - `00`, `01`, ..., `59`
|
||||
* **%f**: Microsecond (zero-padded to 6 digits) - `000000`
|
||||
* **%z**: UTC offset - `(empty)`, `+0000`, `-0400`
|
||||
* **%Z**: Time zone name - `(empty)`, `UTC`, `GMT`
|
||||
* **%j**: Day of the year (zero-padded) - `001`, `002`, ..., `366`
|
||||
* **%U**: Week number of the year (starting Sunday) - `00`, ..., `53`
|
||||
* **%W**: Week number of the year (starting Monday) - `00`, ..., `53`
|
||||
* **%c**: Date and time - `Tue Aug 16 21:30:00 1988`
|
||||
* **%x**: Date standard format - `08/16/1988`
|
||||
* **%X**: Time standard format - `21:30:00`
|
||||
* **%%**: Literal '%' character
|
||||
|
||||
Some placeholders depend on the locale of the underlying system - in most cases this locale is configured as en/US. For more information see the [Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).
|
||||
type: string
|
||||
examples:
|
||||
- "%Y-%m-%dT%H:%M:%S.%f%z"
|
||||
- "%Y-%m-%d"
|
||||
- "%s"
|
||||
cursor_granularity:
|
||||
title: Cursor Granularity
|
||||
description:
|
||||
@@ -1283,11 +1313,39 @@ definitions:
|
||||
- "{{ config['start_time'] }}"
|
||||
datetime_format:
|
||||
title: Datetime Format
|
||||
description: Format of the datetime value. Defaults to "%Y-%m-%dT%H:%M:%S.%f%z" if left empty. Use %s if the datetime value is in epoch time (Unix timestamp).
|
||||
description: |
|
||||
Format of the datetime value. Defaults to "%Y-%m-%dT%H:%M:%S.%f%z" if left empty. Use placeholders starting with "%" to describe the format the API is using. The following placeholders are available:
|
||||
* **%s**: Epoch unix timestamp - `1686218963`
|
||||
* **%a**: Weekday (abbreviated) - `Sun`
|
||||
* **%A**: Weekday (full) - `Sunday`
|
||||
* **%w**: Weekday (decimal) - `0` (Sunday), `6` (Saturday)
|
||||
* **%d**: Day of the month (zero-padded) - `01`, `02`, ..., `31`
|
||||
* **%b**: Month (abbreviated) - `Jan`
|
||||
* **%B**: Month (full) - `January`
|
||||
* **%m**: Month (zero-padded) - `01`, `02`, ..., `12`
|
||||
* **%y**: Year (without century, zero-padded) - `00`, `01`, ..., `99`
|
||||
* **%Y**: Year (with century) - `0001`, `0002`, ..., `9999`
|
||||
* **%H**: Hour (24-hour, zero-padded) - `00`, `01`, ..., `23`
|
||||
* **%I**: Hour (12-hour, zero-padded) - `01`, `02`, ..., `12`
|
||||
* **%p**: AM/PM indicator
|
||||
* **%M**: Minute (zero-padded) - `00`, `01`, ..., `59`
|
||||
* **%S**: Second (zero-padded) - `00`, `01`, ..., `59`
|
||||
* **%f**: Microsecond (zero-padded to 6 digits) - `000000`, `000001`, ..., `999999`
|
||||
* **%z**: UTC offset - `(empty)`, `+0000`, `-0400`, `+1030`, `+063415`, `-030712.345216`
|
||||
* **%Z**: Time zone name - `(empty)`, `UTC`, `GMT`
|
||||
* **%j**: Day of the year (zero-padded) - `001`, `002`, ..., `366`
|
||||
* **%U**: Week number of the year (Sunday as first day) - `00`, `01`, ..., `53`
|
||||
* **%W**: Week number of the year (Monday as first day) - `00`, `01`, ..., `53`
|
||||
* **%c**: Date and time representation - `Tue Aug 16 21:30:00 1988`
|
||||
* **%x**: Date representation - `08/16/1988`
|
||||
* **%X**: Time representation - `21:30:00`
|
||||
* **%%**: Literal '%' character
|
||||
|
||||
Some placeholders depend on the locale of the underlying system - in most cases this locale is configured as en/US. For more information see the [Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).
|
||||
type: string
|
||||
default: ""
|
||||
examples:
|
||||
- "%Y-%m-%dT%H:%M:%S.%f%"
|
||||
- "%Y-%m-%dT%H:%M:%S.%f%z"
|
||||
- "%Y-%m-%d"
|
||||
- "%s"
|
||||
max_datetime:
|
||||
|
||||
@@ -453,8 +453,8 @@ class MinMaxDatetime(BaseModel):
|
||||
)
|
||||
datetime_format: Optional[str] = Field(
|
||||
"",
|
||||
description='Format of the datetime value. Defaults to "%Y-%m-%dT%H:%M:%S.%f%z" if left empty. Use %s if the datetime value is in epoch time (Unix timestamp).',
|
||||
examples=["%Y-%m-%dT%H:%M:%S.%f%", "%Y-%m-%d", "%s"],
|
||||
description='Format of the datetime value. Defaults to "%Y-%m-%dT%H:%M:%S.%f%z" if left empty. Use placeholders starting with "%" to describe the format the API is using. The following placeholders are available:\n * **%s**: Epoch unix timestamp - `1686218963`\n * **%a**: Weekday (abbreviated) - `Sun`\n * **%A**: Weekday (full) - `Sunday`\n * **%w**: Weekday (decimal) - `0` (Sunday), `6` (Saturday)\n * **%d**: Day of the month (zero-padded) - `01`, `02`, ..., `31`\n * **%b**: Month (abbreviated) - `Jan`\n * **%B**: Month (full) - `January`\n * **%m**: Month (zero-padded) - `01`, `02`, ..., `12`\n * **%y**: Year (without century, zero-padded) - `00`, `01`, ..., `99`\n * **%Y**: Year (with century) - `0001`, `0002`, ..., `9999`\n * **%H**: Hour (24-hour, zero-padded) - `00`, `01`, ..., `23`\n * **%I**: Hour (12-hour, zero-padded) - `01`, `02`, ..., `12`\n * **%p**: AM/PM indicator\n * **%M**: Minute (zero-padded) - `00`, `01`, ..., `59`\n * **%S**: Second (zero-padded) - `00`, `01`, ..., `59`\n * **%f**: Microsecond (zero-padded to 6 digits) - `000000`, `000001`, ..., `999999`\n * **%z**: UTC offset - `(empty)`, `+0000`, `-0400`, `+1030`, `+063415`, `-030712.345216`\n * **%Z**: Time zone name - `(empty)`, `UTC`, `GMT`\n * **%j**: Day of the year (zero-padded) - `001`, `002`, ..., `366`\n * **%U**: Week number of the year (Sunday as first day) - `00`, `01`, ..., `53`\n * **%W**: Week number of the year (Monday as first day) - `00`, `01`, ..., `53`\n * **%c**: Date and time representation - `Tue Aug 16 21:30:00 1988`\n * **%x**: Date representation - `08/16/1988`\n * **%X**: Time representation - `21:30:00`\n * **%%**: Literal \'%\' character\n\n Some placeholders depend on the locale of the underlying system - in most cases this locale is configured as en/US. For more information see the [Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).\n',
|
||||
examples=["%Y-%m-%dT%H:%M:%S.%f%z", "%Y-%m-%d", "%s"],
|
||||
title="Datetime Format",
|
||||
)
|
||||
max_datetime: Optional[str] = Field(
|
||||
@@ -806,8 +806,8 @@ class DatetimeBasedCursor(BaseModel):
|
||||
)
|
||||
datetime_format: str = Field(
|
||||
...,
|
||||
description="The datetime format of the Cursor Field.",
|
||||
examples=["%Y-%m-%dT%H:%M:%S.%f%z"],
|
||||
description="The datetime format of the Cursor Field. Use placeholders starting with \"%\" to describe the format the API is using. The following placeholders are available:\n * **%s**: Epoch unix timestamp - `1686218963`\n * **%a**: Weekday (abbreviated) - `Sun`\n * **%A**: Weekday (full) - `Sunday`\n * **%w**: Weekday (decimal) - `0` (Sunday), `6` (Saturday)\n * **%d**: Day of the month (zero-padded) - `01`, `02`, ..., `31`\n * **%b**: Month (abbreviated) - `Jan`\n * **%B**: Month (full) - `January`\n * **%m**: Month (zero-padded) - `01`, `02`, ..., `12`\n * **%y**: Year (without century, zero-padded) - `00`, `01`, ..., `99`\n * **%Y**: Year (with century) - `0001`, `0002`, ..., `9999`\n * **%H**: Hour (24-hour, zero-padded) - `00`, `01`, ..., `23`\n * **%I**: Hour (12-hour, zero-padded) - `01`, `02`, ..., `12`\n * **%p**: AM/PM indicator\n * **%M**: Minute (zero-padded) - `00`, `01`, ..., `59`\n * **%S**: Second (zero-padded) - `00`, `01`, ..., `59`\n * **%f**: Microsecond (zero-padded to 6 digits) - `000000`\n * **%z**: UTC offset - `(empty)`, `+0000`, `-0400`\n * **%Z**: Time zone name - `(empty)`, `UTC`, `GMT`\n * **%j**: Day of the year (zero-padded) - `001`, `002`, ..., `366`\n * **%U**: Week number of the year (starting Sunday) - `00`, ..., `53`\n * **%W**: Week number of the year (starting Monday) - `00`, ..., `53`\n * **%c**: Date and time - `Tue Aug 16 21:30:00 1988`\n * **%x**: Date standard format - `08/16/1988`\n * **%X**: Time standard format - `21:30:00`\n * **%%**: Literal '%' character\n\n Some placeholders depend on the locale of the underlying system - in most cases this locale is configured as en/US. For more information see the [Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes).\n",
|
||||
examples=["%Y-%m-%dT%H:%M:%S.%f%z", "%Y-%m-%d", "%s"],
|
||||
title="Cursor Field Datetime Format",
|
||||
)
|
||||
cursor_granularity: Optional[str] = Field(
|
||||
|
||||
@@ -20,7 +20,7 @@ To configure incremental syncs for a stream in the connector builder, you have t
|
||||
|
||||
In the builder UI, these things are specified like this:
|
||||
* The "Cursor field" is the property in the record that defines the date and time when the record got changed. It's used to decide which records are synced already and which records are "new"
|
||||
* The "Datetime format" specifies the [format](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes) the cursor field is using to specify date and time,
|
||||
* The "Datetime format" specifies the format the cursor field is using to specify date and time. Check out the [YAML reference](/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/DatetimeBasedCursor) for a full list of supported formats.
|
||||
* The "Cursor granularity" is the smallest time unit supported by the API to specify the time range to request records for expressed as [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations)
|
||||
* The "Start datetime" is the initial start date of the time range to fetch records for. When doing incremental syncs, the second sync will overwrite this date with the last record that got synced so far.
|
||||
* The "End datetime" is the end date of the time range to fetch records for. In most cases it's set to the current date and time when the sync is started to sync all changes that happened so far.
|
||||
|
||||
Reference in New Issue
Block a user