Making WordPress.org

Changeset 7037


Ignore:
Timestamp:
04/05/2018 05:20:12 PM (7 years ago)
Author:
iandunn
Message:

WP15: Rename date/time variables to improve clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wp15.wordpress.net/public_html/content/plugins/wp15-meetup-events/wp15-meetup-events.php

    r7036 r7037  
    300300 * Format a UTC timestamp with respect to the local timezone.
    301301 *
    302  * @param int    $utc_time
     302 * @param int    $utc_timestamp
    303303 * @param string $timezone
    304304 *
    305305 * @return string
    306306 */
    307 function get_local_formatted_date( $utc_time, $timezone ) {
     307function get_local_formatted_date( $utc_timestamp, $timezone ) {
    308308    $date_format = _x( 'F jS, Y g:ia', 'WP15 event date format', 'wp15' );
    309309
    310310    try {
    311         $local_timestamp = new DateTime( '@' . $utc_time );
    312         $local_timestamp->setTimezone( new DateTimeZone( $timezone ) );
    313         $local_timestamp = $local_timestamp->format( $date_format );
     311        $utc_datetime = new DateTime( '@' . $utc_timestamp );
     312        $utc_datetime->setTimezone( new DateTimeZone( $timezone ) );
     313        $formatted_date = $utc_datetime->format( $date_format );
    314314    } catch ( Exception $exception ) {
    315         $local_timestamp = '';
    316     }
    317 
    318     return $local_timestamp;
    319 }
     315        $formatted_date = '';
     316    }
     317
     318    return $formatted_date;
     319}
Note: See TracChangeset for help on using the changeset viewer.