How to find out the next Friday using RelativeDateTime

John Machin sjmachin at lexicon.net
Thu Mar 23 20:46:45 CET 2006


On 24/03/2006 6:30 AM, vj wrote:
> I figured out how to do it. This does not work:
> 
> delta = ReltaiveDateTime(days=0, weekday(mx.DateTime.Friday, 0))
> 
> But this works:
> 
> delta = ReltaiveDateTime(days=+0, weekday(mx.DateTime.Friday, 0))
> 

vj, NEITHER of those work, because you still have the two typos. 
Secondly, there is absolutely no difference in Python between 0 and +0.
PLEASE post actual code (plus the results of running it), like this 
(which continues from my previous posting):

 >>> delta2=RelativeDateTime(days=0, weekday=(Saturday, 0))
 >>> delta3=RelativeDateTime(days=+0, weekday=(Saturday, 0))
 >>> delta2
<RelativeDateTime instance for 'YYYY-MM-DD Sat:0 HH:MM:SS' at 0xae5f08>
 >>> delta3
<RelativeDateTime instance for 'YYYY-MM-DD Sat:0 HH:MM:SS' at 0xb01468>
 >>> a+delta2 == a+delta3
True
 >>> a+delta == a+delta2 == a+delta3
True
 >>>

Cheers,
John



More information about the Python-list mailing list