How can I get an ISO date (not localized) from a PloneFormGen results template?

311 Views Asked by At

How do I get an ISO date (2010-01-01 00:00:00), in addition to the localized date, in a PloneFormGen mailer template?

1

There are 1 best solutions below

0
On BEST ANSWER

Do you want this for the current date/time, or for a date/time submitted via the form?

Regardless, if you have a Zope DateTime instance, you can get an ISO representation like this:

>>> mydate.ISO()

If you want it in UTC, it's easy to convert it:

>>> mydate.toZone('UTC').ISO()