How to add a date stamp field

From Sohowiki
(Difference between revisions)
Jump to: navigation, search
 
 
Line 9: Line 9:
 
  <input type="hidden" name="datestamp" value="m-d-Y"/>
 
  <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.
+
'''Note1:''' 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'.
+
'''Note2:''' The default date format is 'month-day-year' like '02-27-1983'.
  
''Note3:'' For custom formats, use the [http://us3.php.net/manual/en/function.date.php standard php date abreviations]
+
'''Note3:''' For custom formats, use the [http://us3.php.net/manual/en/function.date.php standard php date abreviations]

Latest revision as of 16:25, 6 May 2009

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"/>

Note1: 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