title: WordPress - Display Current Date & Time Based on Website Timezone
body: <p>I'm trying to display the current date and time on my WordPress website. I want the date and time to reflect the Timezone that has been set in the WordPress admin area.</p>
  
  <p>I found this code in options-general.php:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;th scope="row"&gt;&lt;?php _e('Date Format') ?&gt;&lt;/th&gt;
  &lt;td&gt;
      &lt;fieldset&gt;&lt;legend class="screen-reader-text"&gt;&lt;span&gt;&lt;?php _e('Date Format') ?&gt;&lt;/span&gt;&lt;/legend&gt;
  &lt;?php
  
      $date_formats = array_unique( apply_filters( 'date_formats', array(
          __('F j, Y'),
          'Y/m/d',
          'm/d/Y',
          'd/m/Y',
      ) ) );
  
      $custom = true;
  
      foreach ( $date_formats as $format ) {
          echo "\t&lt;label title='" . esc_attr($format) . "'&gt;&lt;input type='radio' name='date_format' value='" . esc_attr($format) . "'";
          if ( get_option('date_format') === $format ) { // checked() uses "==" rather than "==="
              echo " checked='checked'";
              $custom = false;
          }
          echo ' /&gt; &lt;span&gt;' . date_i18n( $format ) . "&lt;/span&gt;&lt;/label&gt;&lt;br /&gt;\n";
      }
  
      echo '  &lt;label&gt;&lt;input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
      checked( $custom );
      echo '/&gt; ' . __('Custom:') . ' &lt;/label&gt;&lt;input type="text" name="date_format_custom" value="' . esc_attr( get_option('date_format') ) . '" class="small-text" /&gt; &lt;span class="example"&gt; ' . date_i18n( get_option('date_format') ) . "&lt;/span&gt; &lt;span class='spinner'&gt;&lt;/span&gt;\n";
  
      echo "\t&lt;p&gt;" . __('&lt;a href="http://codex.wordpress.org/Formatting_Date_and_Time"&gt;Documentation on date and time formatting&lt;/a&gt;.') . "&lt;/p&gt;\n";
  ?&gt;
      &lt;/fieldset&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>I tried adding:</p>
  
  <pre><code>&lt;?php m/d/Y ?&gt;
  </code></pre>
  
  <p>To my website code to output the current date but it didn't work. What am I missing?</p>