2

我需要在 trasmogrification 期间将字符串转换为 DateTime。像这样的东西:

[set-startDate]
blueprint = collective.transmogrifier.sections.inserter
condition = python: item.has_key('startDate')
key = string:startDate
value = python: <conversion to DateTime>

我怎样才能做到这一点?

4

1 回答 1

2

查看collective.transmogrifier的文档,我找到了答案:

[set-startDate]
blueprint = collective.transmogrifier.sections.inserter
condition = python: item.has_key('startDate')
key = string:startDate
value = python: modules['DateTime'].DateTime(item['startDate'])
于 2011-11-10T17:39:01.923 回答