From ece59bf72a6975ad1c59fd3292453422f9c1ba96 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Fri, 21 Aug 2015 18:16:25 +0000 Subject: [PATCH] Add new constant MONTH_IN_SECONDS and expand time convenience documentation. The "month" isn't really a month. It's a WordPress Month. As the docs make clear, it's not about accuracy as much as it about convenience. This adds a missing step in the time convenience constants. Props egill Fixes #33397 Built from https://develop.svn.wordpress.org/trunk@33698 git-svn-id: http://core.svn.wordpress.org/trunk@33665 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/default-constants.php | 13 +++++++++++-- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php index 7325845966..ea42f86dbe 100644 --- a/wp-includes/default-constants.php +++ b/wp-includes/default-constants.php @@ -95,12 +95,21 @@ function wp_initial_constants() { // Constants for features added to WP that should short-circuit their plugin implementations define( 'WP_FEATURE_BETTER_PASSWORDS', true ); - // Constants for expressing human-readable intervals - // in their respective number of seconds. + /** + * Constants for expressing human-readable intervals + * in their respective number of seconds. + * + * Please note that these values are approximate and are provided for convenience. + * For example, MONTH_IN_SECONDS wrongly assumes every month has 30 days and + * YEAR_IN_SECONDS does not take leap years into account. + * + * If you need more accuracy please consider using the DateTime class (http://php.net/manual/class.datetime.php). + */ define( 'MINUTE_IN_SECONDS', 60 ); define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS ); define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS ); define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS ); + define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS ); define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 8f7c0c1cc2..b62d88ea53 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33697'; +$wp_version = '4.4-alpha-33698'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.