WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/25/2012 05:26:19 AM (9 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-admin/includes/upgrade.php

    r21823 r21996  
    512512
    513513        $server_time = time()+date('Z');
    514     $weblogger_time = $server_time + $time_difference*3600;
     514    $weblogger_time = $server_time + $time_difference * HOUR_IN_SECONDS;
    515515    $gmt_time = time();
    516516
    517     $diff_gmt_server = ($gmt_time - $server_time) / 3600;
    518     $diff_weblogger_server = ($weblogger_time - $server_time) / 3600;
     517    $diff_gmt_server = ($gmt_time - $server_time) / HOUR_IN_SECONDS;
     518    $diff_weblogger_server = ($weblogger_time - $server_time) / HOUR_IN_SECONDS;
    519519    $diff_gmt_weblogger = $diff_gmt_server - $diff_weblogger_server;
    520520    $gmt_offset = -$diff_gmt_weblogger;
Note: See TracChangeset for help on using the changeset viewer.