You are here: Home / Documentation / How To's / How to get current date into a PFG field

How to get current date into a PFG field

by ledwell published Nov 13, 2013 02:50 PM, last modified Aug 16, 2016 10:50 AM
Displaying the current date in form field using PloneFormGen
  • Create a pfg form
  • Add a "string field"
  • Choose the "Overrides" tab
  • Add the following code in the "Default Expression" field
python:DateTime().strftime("%m/%d/%Y %I:%M:%S %p")
This should display the current date in this format
 
11/13/2013 13:38:17
 
Navigation