1

我曾经在 Visual Basic 中有这段代码:

rpt.ParameterFields.GetItemByName("RowDate").AddCurrentValue CDate("2010-03-19")

而且我无法弄清楚我必须将日期转换成什么才能使 COM 可食用。

有什么建议么?

4

1 回答 1

2

好的,找到了解决方案。贝娄是python等价的:

rpt.ParameterFields.GetItemByName("RowDate").AddCurrentValue(datetime.datetime.strptime('2010-03-19', "%Y-%m-%d").date())

方法与以下相同: Python date string to date object

于 2010-10-19T14:22:02.517 回答