How to add a date stamp field

From Sohowiki
Revision as of 16:25, 6 May 2009 by Soho (Talk | contribs)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

If you're building a custom form that will submit through the standard pgm-form_submit.php, you can include a hidden field in your form that will automatically insert the current date into the database record when your form is submitted.

Just add a hidden field called "datestamp", like so...

Example of datestamp field with default date format (empty value)
<input type="hidden" name="datestamp" value=""/>
Example of datestamp field with custom date format...
<input type="hidden" name="datestamp" value="m-d-Y"/>

Note: The value should be blank, or custom depending on how you want your date formatted.

Note2: The default date format is 'month-day-year' like '02-27-1983'.

Note3: For custom formats, use the standard php date abreviations

Personal tools