In my settings, I have New York defined as the time zone. But when I run plugins using PHP date() functions, I am getting a time zone of UTC as it shows in WP Admin > Settings > General.
Edit: Here's the mu-plugin I use to add the meta tag:
<?php
/**
* Plugin Name: Web Services Global Meta Tag(s)
* Plugin URI: http://example.com/wp-content/mu-plugins/global-metatag-insertion.php
* Description: This plugin fires on every page and post in the WordPress Multisite Network. It adds custom meta tags to meets our needs. One meta tag that is added is for `last-modified` date.
* Version: 1.0
* Author: me
* Author URI: http://me.example.com/
*/
defined( 'ABSPATH' ) or die( 'Direct access not allowed' );
/**
* Insert `last-modified` date meta within `<head></head>` container
*/
function last_modified_date() {
echo '<meta http-equiv="last-modified" content="' . date( 'D, d M Y H:i:s T', strtotime( get_the_date() .' ' . get_the_time() ) ) . '" />' . "\n";
}
add_action( 'wp_head', 'last_modified_date' );
meta
tag? You probably just use the wrong function and make no use of the actual option set in the admin UI.current_time
.