Skip to content

Commit ab89773

Browse files
release: 0.5.11
1 parent 4d0d699 commit ab89773

5 files changed

Lines changed: 48 additions & 3 deletions

File tree

docs/docs/content/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,25 @@ All notable changes to Rayforce-Py will be documented in this file.
55
!!! note ""
66
You can also subscribe for release notifications by joining our [:simple-zulip: Zulip](https://rayforcedb.zulipchat.com/#narrow/channel/549008-Discuss)!
77

8+
## **`0.5.11`**
9+
10+
### New Features
11+
12+
- **`Timestamp.shift_tz()` method**: Shift a `Timestamp` value by a timezone offset. Accepts any `datetime.tzinfo` (including `datetime.timezone` and `zoneinfo.ZoneInfo`).
13+
14+
- **`Column.shift_tz()` for queries**: Shift an entire column of timestamps by a timezone offset within `select()` expressions.
15+
16+
2026-02-19 | **[🔗 PyPI](https://pypi.org/project/rayforce-py/0.5.11/)** | **[🔗 GitHub](https://github.com/RayforceDB/rayforce-py/releases/tag/0.5.11)**
17+
18+
819
## **`0.5.10`**
920

1021
### Bug Fixes
1122
- Various bugfixes to the database operations
1223

1324
2026-02-11 | **[🔗 PyPI](https://pypi.org/project/rayforce-py/0.5.10/)** | **[🔗 GitHub](https://github.com/RayforceDB/rayforce-py/releases/tag/0.5.10)**
1425

26+
1527
## **`0.5.9`**
1628

1729
### Bug Fixes

docs/docs/content/documentation/data-types/temporal.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,36 @@ Timestamp(datetime.datetime(2025, 5, 10, 14, 30, 45, tzinfo=datetime.timezone.ut
7878
>>> timestamp
7979
datetime.datetime(2025, 5, 10, 14, 30, 45, tzinfo=datetime.timezone.utc)
8080
```
81+
82+
### Shift Timezone
83+
84+
The `shift_tz()` method shifts a `Timestamp` by a timezone offset, returning a new `Timestamp`. The original value is not mutated. It accepts any `datetime.tzinfo`, including `datetime.timezone` and `zoneinfo.ZoneInfo`.
85+
86+
```python
87+
>>> import datetime as dt
88+
>>> from zoneinfo import ZoneInfo
89+
>>> from rayforce import Timestamp
90+
91+
>>> ts = Timestamp(dt.datetime(2025, 6, 15, 12, 0, 0, tzinfo=dt.UTC))
92+
93+
>>> ts.shift_tz(dt.timezone(dt.timedelta(hours=5)))
94+
Timestamp(datetime.datetime(2025, 6, 15, 17, 0, 0, tzinfo=datetime.timezone.utc))
95+
96+
>>> ts.shift_tz(dt.timezone(dt.timedelta(hours=-5)))
97+
Timestamp(datetime.datetime(2025, 6, 15, 7, 0, 0, tzinfo=datetime.timezone.utc))
98+
99+
>>> ts.shift_tz(ZoneInfo("Etc/GMT-5")) # Etc/GMT-5 = UTC+5
100+
Timestamp(datetime.datetime(2025, 6, 15, 17, 0, 0, tzinfo=datetime.timezone.utc))
101+
```
102+
103+
`shift_tz` is also available on `Column` for use in queries, allowing you to shift an entire column of timestamps:
104+
105+
```python
106+
>>> import datetime as dt
107+
>>> from rayforce import Table, Column
108+
109+
>>> result = table.select(
110+
"id",
111+
local_time=Column("created_at").shift_tz(dt.timezone(dt.timedelta(hours=3))),
112+
).execute()
113+
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "rayforce_py"
7-
version = "0.5.10"
7+
version = "0.5.11"
88
description = "Python bindings for RayforceDB"
99
readme = "README.md"
1010
authors = [{name = "Karim"}]

rayforce/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
FFI.init_runtime()
1212

13-
version = "0.5.10"
13+
version = "0.5.11"
1414

1515
if sys.platform == "linux":
1616
lib_name = "_rayforce_c.so"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def has_ext_modules(self):
99

1010
setup(
1111
name="rayforce_py",
12-
version="0.5.10",
12+
version="0.5.11",
1313
packages=find_packages(),
1414
package_data={
1515
"rayforce": ["*.so", "*.dylib", "*.pyi", "bin/rayforce"],

0 commit comments

Comments
 (0)