Often you don’t want to query events between two set dates, but dates relative in time. For instance you might want to display upcoming events this month, or events just finished, etc. Event Organiser allows you to give certain date-related query arguments ‘relative dates’. For example, tomorrow, now, +1 week, third Thursday of this month.

Test the relative dates

Current time:
Monday 14th June 2021, 12:24am (UTC)

"last day of -3 month":
31st March 2021, 12:24am (UTC)

 

Please note that these strings are interpreted using PHP’s datetime object. See allowed statements here. Some PHP versions do not support all the statements.

For example first day of this month is only supported by PHP 5.3+