Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Converts a Unix timestamp to local time, as defined in the WordPress settings (Settings --> General --> Timezone)
- * @author Ren Ventura <renventura.com>
- *
- * @param int $timestamp Unix timestamp (e.g. PHP time() function)
- * @param string $format Output format
- *
- * @return string Formatted time
- */
- function wp_local_time( $timestamp, $format = 'F j, Y g:i:s a' ) {
- return get_date_from_gmt( date_i18n( 'Y-m-d H:i:s', $timestamp ), $format );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement