How to find out if february has 29 or 28 days ?

Mark McEahern marklists at mceahern.com
Tue Jul 30 11:39:00 EDT 2002


> I use the mx.DateTime package, and I need to know if in one 
> particular year 
> has a february with 28 or 29 days ? I don't know how to do that !

import mx.DateTime
d = mx.DateTime.DateTimeFrom("2/1/2002")
print d.days_in_month == 28

d2 = d + mx.DateTime.RelativeDateTime(years=2)
print d2.days_in_month == 29

// m
-





More information about the Python-list mailing list