daft.functions.replace_time_zone#
replace_time_zone #
replace_time_zone(expr: Expression, timezone: str | None = None) -> Expression
Replaces the timezone of a timestamp while preserving the local time.
If timezone is not provided, the timezone is removed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr | Expression | Timestamp expression to update. | required |
timezone | str | None | New timezone (e.g. "UTC", "+02:00", "America/New_York"). | None |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Expression | Timestamp expression with the updated timezone. |
Source code in daft/functions/datetime.py
1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 | |