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.relative.php.
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: 22-06-2023

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

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close