开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜