RxPY
RxPY copied to clipboard
`AsyncIOScheduler.now` returns a datetime in 1970.
Describe the bug
AsyncIOScheduler.now returns a datetime in 1970.
To Reproduce
python -c '
import asyncio
from reactivex.scheduler.eventloop.asyncioscheduler import AsyncIOScheduler
async def print_now():
print("Current time:", AsyncIOScheduler(asyncio.get_running_loop()).now)
asyncio.run(print_now())
'
Expected behavior It should print a datetime in 2025
Actual output
/home/nixos/agentic-sql.rxpy/.devenv/state/venv/lib/python3.12/site-packages/reactivex/internal/constants.py:4: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
UTC_ZERO = datetime.utcfromtimestamp(0)
/home/nixos/agentic-sql.rxpy/.devenv/state/venv/lib/python3.12/site-packages/reactivex/scheduler/scheduler.py:148: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
value = datetime.utcfromtimestamp(value)
Current time: 1970-01-01 22:07:49.554005
Additional context Add any other context about the problem here.
- OS: Linux
- RxPY version: 4.0.4
- Python version: 3.12.10