How to convert a string into a DateTime in a trasmogrifier step?

219 views Asked by At

I need to convert a string into a DateTime during a trasmogrification. Something like this:

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

How can I achieve this?

1

There are 1 answers

0
Giacomo Spettoli On BEST ANSWER

Looking at the doc of collective.transmogrifier, I've found my answer:

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