gwp_date_updated
The gwp_date_updated Merge Tag returns a modified date time relative to the date time when the entry was last updated 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_updated modify="first day of next month" format="d-m-Y"}
When the entry is updated on 2021-03-30 12:21:23 this returns ’01-04-2021′
{gwp_date_updated format="d/m/Y\ \a\t\ H:i:s"}
When the entry is updated on 2021-03-30 12:21:23 this returns ’30-03-2021 at 12:21:23′
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_updated modify="+*|Number of days:3|* days" format="d-m-Y"}
gwp_date_updated needs an entry, so it works in notifications, confirmations, GravityView, Gravity Flow and other places that run after submission.
For more modify examples, see Relative Date Formats in Gravity Forms.
Frequently Asked Questions
You can use the {gwp_date_updated} merge tag to show when an entry was last updated. By default, it returns the date and time in Y-m-d H:i:s format.
Example:
{gwp_date_updated}
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_updated format="d/m/Y H:i:s"}
Yes. Use the modify option to adjust the displayed date/time relative to when the entry was last updated.
Example:
{gwp_date_updated modify="+1 week" format="d-m-Y"}
You can apply the timezone option to display the updated date in your desired timezone.
Example:
{gwp_date_updated timezone="Europe/Amsterdam" format="d-m-Y H:i:s"}
If an entry was never updated after submission, {gwp_date_updated} returns the original entry creation time.