[wp-trac] [WordPress Trac] #33397: Add constant MONTH_IN_SECONDS

WordPress Trac noreply at wordpress.org
Sat Aug 22 00:46:11 UTC 2015


#33397: Add constant MONTH_IN_SECONDS
---------------------------------------+-----------------------
 Reporter:  toscho                     |       Owner:  egill
     Type:  enhancement                |      Status:  reopened
 Priority:  normal                     |   Milestone:  4.4
Component:  General                    |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  good-first-bug needs-docs  |     Focuses:
---------------------------------------+-----------------------

Comment (by egill):

 Replying to [comment:13 GaryJ]:
 > Per standard PHP documentation parsing, the `/** ... */` DocBlock here
 is only applying to the first constant.
 >
 > Instead, it should wrap around all of the `define()`'s, like
 [https://github.com/WordPress/WordPress/blob/master/wp-config-
 sample.php#L40-L58 wp-config.php] does.

 You're absolutely right. So this would be more like it?:

 {{{
         /**#@+
          * 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    );
         /**#@-*/
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33397#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list