RxPY icon indicating copy to clipboard operation
RxPY copied to clipboard

`AsyncIOScheduler.now` returns a datetime in 1970.

Open Atry opened this issue 10 months ago • 1 comments

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

Atry avatar Jun 13 '25 21:06 Atry

Thanks for reporting this issue. This will be fixed as part of #743

dbrattli avatar Nov 09 '25 16:11 dbrattli