Question

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

Was it helpful?

Solution

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()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top