469,319 Members | 2,291 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,319 developers. It's quick & easy.

dateutil and dates before today

I'm using the dateutil module from http://labix.org/python-dateutil.

Am I right in thinking that the rrules module doesn't acknowledge days
before today?

An example of the issue:
rule_temp = rrule(YEARLY,bymonth=1,bymonthday=1)
print rule_temp.between(datetime(2006,12,1),datetime(200 7,1,4),True) [datetime.datetime(2007, 1, 1, 19, 21, 29)] print rule_temp.between(datetime(2005,12,1),datetime(200 6,1,4),True) [] print rule_temp.between(datetime(2005,12,1),datetime(200 7,1,4),True) [datetime.datetime(2007, 1, 1, 19, 21, 29)] print rule_temp.before(datetime.today(),True) None print rule_temp.after(datetime.today(),True)

2007-01-01 19:21:29

Basically, it doesn't seem to acknowledge any dates before today. Is
this right?

Cheers

Matt

Feb 26 '06 #1
1 1389
I'll answer my own post.

If you don't specify dtstart, it defaults to datetime.today().
Therefore, there are no instances before today. Specify dtstart as a
historic date, and it works on any dates after dtstart.

Wish I'd engaged brain before posting.

Matt

Feb 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Smoke | last post: by
2 posts views Thread by Rachel Suddeth | last post: by
2 posts views Thread by Duppypog | last post: by
5 posts views Thread by Elainie | last post: by
5 posts views Thread by soni2926 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.