Q&A and More
- SOURCE: Support Forum
- OUR RESPONSE TIME: 10 Minutes
- USER'S REPLY/REVIEW: “That worked perfectly, thanks!“
Support forum user jstraete posted;
“I would like to output the date created and date last updated for a Formidable Form into a PDF template.
I do not have fields for those dates in my form, but I'm fairly certain they are stored in the database.
Is there any shortcode available to generate those dates?”
Use Formidable Form's [created_at] and [updated_at] shortcodes.
To format the date, use Formidable Forms' default syntax: https://formidableforms.com/knowledgebase/advanced/#kb-date-format
The date format can also be in the form of Time Ago.
From Formidable Forms' support page;
Display the amount of time between a saved date and today's date. You can use this with a date field, created_at, or updated_at shortcode. If using time_ago with created_at or updated_at, you may determine how many time measurements should appear.
For example, if there is a date selected that was almost 16 days away, various options will return different results. Here are a few examples:
Shortcode Result [created_at time_ago=3] 2 weeks 1 day 23 hours [created_at time_ago=1] 2 weeks [created_at time_ago=week] 2 weeks [created_at time_ago=day] 15 days [created_at time_ago=hour] 383 hours
The time_ago option accepts the following values:
y or year: “# years”
m or month: “# months”
w or week: “# weeks”
d or day: “# days”
h or hour: “# hours”
m or minute: “# minutes”
s or seconds: “# seconds”
1, 2, 3, 4, 5, 6, or 7: Set the maximum number of units the result should return
Note: time_ago can only be used in Views, emails, and form success messages. If you want to calculate dates in a form, use the age shortcode.
In fact, nearly all of the Formidable Shortcodes and the Advanced Shortcodes may be used inside your PDF template!
Check out “How to Use Formidable Form Shortcodes in a PDF” for more tips on best practices and downloadable examples, on using Formidable shortcodes in PDF files.