☰
Documentation

gwp_date_created

The gwp_date_created Merge Tag returns a modified date time relative to the date time when the entry was created in the desired format.

Options

modify (optional)For available date time modifications, see https://www.php.net/manual/en/datetime.formats.php#datetime.formats.relative.
format (optional, default =’Y-m-d H:i:s’)For an explanation of available format options, see https://www.php.net/manual/en/datetime.format.php. Regular characters can be escaped using a backslash (\). For example: ‘d/m/Y\ \a\t\ H:i:s’.
timezone (optional, default is WordPress timezone setting)For available timezones, see https://www.php.net/manual/en/timezones.php. For example: Europe/Amsterdam
It is also possible to use an offset value: +0200

Examples

{gwp_date_created modify="+1 day" format="d-m-Y H:i:s"}

When the entry is created on 2021-03-30 12:21:23 this returns ’31-03-2021 12:21:23′


{gwp_date_created modify="-1 day" format="d-m-Y"}

When the entry is created on 2021-03-30 12:21:23 this returns ’29-03-2021′

Use a field value in modify

The modify option supports nested merge tags: write a merge tag with *| and |* instead of curly brackets to use a value from the entry.

{gwp_date_created modify="+*|Number of days:3|* days" format="d-m-Y"}

gwp_date_created needs an entry, so it works in notifications, confirmations, GravityView, Gravity Flow and other places that run after submission. It returns nothing (or an error, depending on the plugin settings) in a field’s default value, because the entry does not exist yet.

For more modify examples, see Relative Date Formats in Gravity Forms.

Frequently Asked Questions

How do I display the exact date/time when an entry was created?

You can use the {gwp_date_created} merge tag to show when an entry was created. By default, it returns the date and time in Y-m-d H:i:s format. Example: {gwp_date_created}

How can I show the entry date in a specific format?

You can customize the display format using the format option. For example, to show the date in day/month/year hours:minutes:seconds format: Example: {gwp_date_created format="d/m/Y H:i:s"}

Can I display a date relative to the entry date?

Yes! The modify parameter supports a wide range of relative date and time phrases — not just simple day offsets. You can shift the displayed date using flexible terms like: Specific days → “last monday”, “next friday” Month-based → “first day of next month”, “last day of previous month” Week-based → “this week”, “next week” Advanced → “third wednesday of this month” You can also combine these formats for very specific adjustments. Example: {gwp_date_created modify="first day of next month" format="d-m-Y"} {gwp_date_created modify="last monday" format="d-m-Y"} {gwp_date_created modify="third wednesday of this month" format="d-m-Y"}

How do I change the timezone of the displayed date?

You can apply the timezone option to display the date in your desired timezone. Example: {gwp_date_created timezone="Europe/Amsterdam" format="d-m-Y H:i:s"}

Can I use {gwp_date_created} as a field default value?

No. A default value is filled in before the entry exists, so {gwp_date_created} returns nothing there. Use it in notifications, confirmations, GravityView or Gravity Flow steps, which run after the entry is created; to store the value in a field, use a Gravity Flow step that updates the entry.

Where can I find all supported date formats and modifiers?

You can view a full guide on supported formats, modify options, and usage examples in our documentation: GravityWP Date Format & Modifiers Reference

Options Examples Use a field value in modify Frequently Asked Questions
Proudly powered by WordPress