Make WordPress Core


Ignore:
Timestamp:
09/25/2012 05:26:19 AM (12 years ago)
Author:
nacin
Message:

Introduce constants to allow for easier expression of time periods in seconds. Adds MINUTE_IN_SECONDS, HOUR_IN_SECONDS, DAY_IN_SECONDS, WEEK_IN_SECONDS, YEAR_IN_SECONDS. props nbachiyski, SergeyBiryukov. fixes #20987.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-constants.php

    r21809 r21996  
    7373    if ( !defined('SHORTINIT') )
    7474        define('SHORTINIT', false);
     75
     76    // Constants for expressing human-interval intervals
     77    // in their respective number of seconds.
     78    define( 'MINUTE_IN_SECONDS', 60 );
     79    define( 'HOUR_IN_SECONDS',   60 * MINUTE_IN_SECONDS );
     80    define( 'DAY_IN_SECONDS',    24 * HOUR_IN_SECONDS   );
     81    define( 'WEEK_IN_SECONDS',    7 * DAY_IN_SECONDS    );
     82    define( 'YEAR_IN_SECONDS',  365 * DAY_IN_SECONDS    );
    7583}
    7684
Note: See TracChangeset for help on using the changeset viewer.