Make WordPress Core


Ignore:
Timestamp:
08/23/2019 01:11:22 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Date/Time: Introduce current_datetime() for better time operations.

Returning a DateTimeImmutable representation of the current moment in time, this allows for a more flexible and reliable use than current_time() provides.

Props Rarst.
Fixes #47464.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r45674 r45883  
    861861
    862862        $today    = current_time( 'Y-m-d' );
    863         $tomorrow = gmdate( 'Y-m-d', strtotime( '+1 day', current_time( 'timestamp' ) ) );
     863        $tomorrow = current_datetime()->modify( '+1 day' )->format( 'Y-m-d' );
    864864        $year     = current_time( 'Y' );
    865865
Note: See TracChangeset for help on using the changeset viewer.