Python Visual Basic's CDate equivalent
I used to have this code in Visual Basic:
rpt.ParameterFields.GetItemByName("RowDate").AddCurrentValu开发者_开发百科e CDate("2010-03-19")
and I cannot figure out into what I have to convert date to make eatable for COM.
Any suggestions?
Ok, found solution. Bellow is python equivalent:
rpt.ParameterFields.GetItemByName("RowDate").AddCurrentValue(datetime.datetime.strptime('2010-03-19', "%Y-%m-%d").date())
Approach is the same like in: Python date string to date object
精彩评论