Documentation

gwp_now

The gwp_now Merge Tag returns the currrent date and / or time or a modified and formatted date / time relative to the current date / time.

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 character 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_now modify="next monday" format="d-m-Y H:i:s"}

When the current time is 2022-03-24 11:21:23, this returns 27-03-2022 11:21:23


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

When the current time is 2023-03-30 12:21:23, this will return 29-03-2023

Last updated: 14-02-2024

Advanced Merge Tagsv1.4

To use the functionalities described in this documentation, you'll need to get the GravityWP - Advanced Merge Tags add-on.

Read more