WP_Date_Query Entrails – GenerateWP
WordPress uses WP_Date_Query class for generating SQL WHERE clauses to filter queries by date. We worked very hard to build an easy-to-use tool to help developers generate multiple date queries. Introducing our new WP_Date_Query Generator. Filtering Posts by Date
Some WordPress queries such as WP_Query had an historical date filtering support. WordPress 3.7 standardized the date filtering mechanism using a helper class to be used in other WordPress queries.
The new WP_Date_Query class accepts time-related parameters (year, month, day, week, dayofweek, dayofweek_iso, hour, minute, second), multiple arrays with compare operators, and multiple arrays with other nested date queries. You can create simple date-based filters and very complex filters, this class provides solutions for almost every scenario.
There are 3 main ways to use the date query: (1) Create an array of simple date parameters. (2) Use a range of dates with before/after parameters. (3) Use relative date ranges with textual descriptions. This may sound complicated but its not and actually very easy to use once you get the hang of it.
The Date Query Generator
We spent a lot of time to create an easy-to-use interface for our
Source: https://managewp.org/articles/13934/wp-date-query-entrails-generatewp
source https://williechiu40.wordpress.com/2016/12/01/wp_date_query-entrails-generatewp/