• Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Sign Up
  • Log Out
  • Get Easy Forms
  • Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Sign Up
  • Log Out
  • Get Easy Forms
home/Knowledge Base/Advanced Techniques/Date Formats with Dynamic Content
Popular Search:Getting Started

Date Formats with Dynamic Content

399 views 1 May 3, 2021 admin

You might think that formatting dates can become tricky if you require a specific format. However, now, you should not be worried about that since in this article, you will be shown how to set a date in almost any format.

Do you know what is Dynamic Content? Click here to read our documentation.

How Are Dates Stored In The Database?

Before to talk about formats, we need to know how dates are stored in the database:

  1. All Date fields are saved in HTML5 format: yyyy-mm-dd. For example, this variable: {{ date_1 }} will have this format by default: 2021-05-03.
  2. The submission datetime is saved as unix timestamp. For example, this {{ created_at }} will have this format: 1620070060.

Date Formatting

To format a date we need to use the “date” filter. The “date” filter gives us complete control of the format. With this filter we can specify the template of the format we want. For example:

Input:

{{ created_at | date: "%m/%d/%Y" }}

Output:

05/05/2021

or

Input:

{{ created_at | date: "%d %B %Y"}}

Output:

05 May 2021

There are many placeholders we can use for date formatting.

Placeholder Format Example
%a Abbreviated weekday Sun
%A Full weekday name Sunday
%b Abbreviated month name Jan
%B Full month name January
%c Preferred local date and time representation Fri Jan 29 11:16:09 2021
%d Day of the month, zero-padded 05
%-d Day of the month 5
%D Formats the date 29/01/21
%e Day of the month 3
%F Returns the date in ISO 8601 format 2021-01-29
%H Hour of the day, 24-hour clock 07
%I Hour of the day, 12-hour clock 04
%j Day of the year 017
%k Hour of the day, 24-hour clock 7
%m Month of the year 04
%M Minute of the hour 09
%p Meridian indicator uppercase AM
%P Meridian indicator lowercase pm
%r 12-hour time 01:31:43 PM
%R 24-hour time 18:09
%T 24-hour time with seconds 18:09:13
%s Number of seconds since 1970-01-01 00:00:00 UTC 1452355261
%S Second of the minute 05
%U Week number of the current year, starting with the first Sunday as the first day of the first week 03
%W Week number of the current year, starting with the first Monday as the first day of the first week 09
%w Day of the week. Sunday is 0 4
%x Preferred representation for the date 05/11/15
%X Preferred representation for the time 17:15:31
%y Year without a century 21
%Y Year with a century 2021
%Z Time zone name PST
%% Literal % character %

That’s everything you need to know about date formats in Easy Forms! You might not think it, but there are a lot of places where you can specify and take advantage of date formats, like Email notifications, PDF documents, SMS notifications and much more.

Tags:Dynamic Content

Was this helpful?

1 Yes  No
Related Articles
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
  • Create Users that Can Only Submit Forms
  • How To Calculate Age From Date Of Birth
  • Calculate the Number of Days between Two Dates

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

You must be logged in to post a comment.

Advanced Techniques
  • Date Formats with Dynamic Content
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
  • Create Users that Can Only Submit Forms
  • How To Calculate Age From Date Of Birth
View All 19  
Popular Articles
  • How to enable / disable DEBUG mode
  • How to update Form Stats from the command line
  • How to RTL (right-to-left) a Form?
  • How to Remove the Default Choice from a Select List Field
  • How to compare two fields to pass the validation (jQuery Validation)
KB Categories
  • Add-Ons
  • Advanced Techniques
  • Common Issues & Troubleshooting
  • Developers "How To's"
  • Getting Started
  • How To

  Dynamic Content: Conditional Logic with Dates

Date Based Conditional Logic  

About Easy Forms

With Easy Forms you can create unlimited web forms and most importantly the complete management of them without paying monthly fees

Resources
  • Knowledge Base
  • Documentation
  • Pre-sales Questions
  • Blog
Useful Help Links
  • Get Easy Forms
  • Live Demo
  • License Terms
  • Contact Us
Frequent Visit Links
  • Pre-Sales Questions
  • System Requirements
  • Installing Easy Forms
  • Upgrading Easy Forms
  • Privacy Policy
  • © 2015 - 2022 Baluart EIRL. All Rights Reserved.

Popular Search:Getting Started