Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tzinfo #42

Closed
aliirz opened this issue Apr 15, 2014 · 2 comments
Closed

Tzinfo #42

aliirz opened this issue Apr 15, 2014 · 2 comments

Comments

@aliirz
Copy link

aliirz commented Apr 15, 2014

Hi everyone I am trying to use the stops feature in my code like this:

         count = 0

        for stop in stops(freq=delorean.DAILY, count=7, start=d1, stop=d2):
            if(stop.date == mydate):
                count = count + 1

But I keep getting this error:

AttributeError: 'datetime.date' object has no attribute 'tzinfo'

I dont understand what I am doing wrong. Will really appreciate the help.

Best

@myusuf3
Copy link
Owner

myusuf3 commented Apr 16, 2014

@aliirz I need more context around this issue. what is stop? what is mydate, d1, d2? maybe send a gist, with sample code.

@cdesales
Copy link

I got the same error using more or less this code:

from datetime import date, date time
from delorean import Delorean

dt = date(2013, 5, 06)
dl = Delorean(dt, timezone="UTC")

This is the workaround I used:

from datetime import date, datetime
from delorean import Delorean

dt = date(2013, 5, 06)
dl = Delorean(datetime(dt.year, dt.month, dt.day), timezone="UTC")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants