Changeset 7037
- Timestamp:
- 04/05/2018 05:20:12 PM (7 years ago)
- 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 300 300 * Format a UTC timestamp with respect to the local timezone. 301 301 * 302 * @param int $utc_time 302 * @param int $utc_timestamp 303 303 * @param string $timezone 304 304 * 305 305 * @return string 306 306 */ 307 function get_local_formatted_date( $utc_time , $timezone ) {307 function get_local_formatted_date( $utc_timestamp, $timezone ) { 308 308 $date_format = _x( 'F jS, Y g:ia', 'WP15 event date format', 'wp15' ); 309 309 310 310 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 ); 314 314 } 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.