title: Validating timezone 'name' coming in from different site?
body: <p>i've got users coming in from a different site and i'm getting that site to send across their timezone in a standard 'tz' format </p>
  
  <pre><code> Antarctica/Casey    Antarctica/Davis   
   Antarctica/DumontDUrville  Antarctica/Macquarie 
   Antarctica/Mawson  Antarctica/McMurdo
  </code></pre>
  
  <p>How do i verify that this 'string' coming in is a VALID timezone entry?</p>
  
  <hr>
  
  <p>this is what i'm doing</p>
  
  <pre><code>        $script_tz = date_default_timezone_get();
          if(!date_default_timezone_set($specifiedTimeZone))
          {
              date_default_timezone_set($script_tz);
              $errormessage = "Invalid TimeZone";
              return;         
          }
          date_default_timezone_set($script_tz);
  </code></pre>
  
  <p>but i dont like it - seems kludgy.</p>
  
  <hr>
  
  <p>testing it out:</p>
  
  <p>Test1
      
  
  <pre><code>$test1 = 'America/New_York';
  $test2 = 'junk';
  
  $start = microtime(true);
  for($i=1;$i&lt;10000;$i++)
  {
      if (in_array($test1, DateTimeZone::listIdentifiers())) {}else {}
      if (in_array($test2, DateTimeZone::listIdentifiers())) {}else {}
  }
  
  $end = microtime(true);
  
  echo $end-$start;
  ?&gt;
  
  9.7208099365234
  </code></pre>
  
  <p>Test2</p>
  
  <pre><code>&lt;?php
  
  $test1 = 'America/New_York';
  $test2 = 'junk';
  
  error_reporting(0);
  $start = microtime(true);
  for($i=1;$i&lt;10000;$i++)
  {
          $script_tz = date_default_timezone_get();
          if(!date_default_timezone_set($test1))
          {
                  date_default_timezone_set($script_tz);
          }
          else
                  date_default_timezone_set($script_tz);
          $script_tz = date_default_timezone_get();
          if(!date_default_timezone_set($test2))
          {
                  date_default_timezone_set($script_tz);
          }
          else
                  date_default_timezone_set($script_tz);
  }
  
  
  $end = microtime(true);
  
  echo $end-$start;
  ?&gt;
  
  0.25762510299683
  </code></pre>