pyres icon indicating copy to clipboard operation
pyres copied to clipboard

UTC datetime

Open duxiaoyao opened this issue 14 years ago • 4 comments

Two bugs with local datetimes:

  • ResQ.enqueue_at: it does not work as expected when you pass a datetime which is not in the local timezone.
  • Job.retry: retry_at & retry_until within the overlapped 1 hour caused by DST adjustment.

There were discussions on the thread "move pyres times from local timezone to UTC" in the mailing list.

Changes did:

  • datetimes from external are converted to UTC in time
    • ResQ.enqueue_at: expects UTC datetime, it will be converted to UTC if it's an aware datetime
  • keep using timestamp for scheduling
  • use UTC datetimes for consistency, use datetime.utcnow() instead of datetime.now(), use datetime.utcfromtimestamp() instead of datetime.fromtimestamp()

duxiaoyao avatar Jun 28 '11 17:06 duxiaoyao

sorry i haven't done anything with this yet. I've been moving houses recently and haven't had time to review. Hopefully I will get time this week.

binarymatt avatar Jul 05 '11 22:07 binarymatt

It would be awesome if this was merged in - UTC everything would be sweet.

shreyansb avatar May 08 '12 01:05 shreyansb

Thanks!

shreyansb avatar May 08 '12 01:05 shreyansb

i'm hoping to sit down and figure out how I can apply this change to the current codebase cleanly. If I have to, i'll pull in bits and pieces.

binarymatt avatar May 08 '12 01:05 binarymatt