title: PHP Offsetting unix timestamp
body: <p>I have a unix timestamp in <code>PHP</code>:</p>
  
  <pre><code>$timestamp = 1346300336;
  </code></pre>
  
  <p>Then I have an offset for timezones which I want to apply. Basically, I want to apply the offset and return a new unix timestamp. The offset follows this format, and unfortunately can't be changed due to compatibility with other code:</p>
  
  <pre><code>$offset_example_1 = "-07:00";
  $offset_example_2 = "+00:00";
  $offset_example_3 = "+07:00";
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>$new_timestamp = strtotime($timestamp . " " . $offset_example_1);
  </code></pre>
  
  <p>But this does <strong>not</strong> work unfortunately :(. Any other ideas?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>After testing, I super surprised, but even this doesn't work:</p>
  
  <pre><code>strtotime("1346300336 -7 hours")
  </code></pre>
  
  <p>Returns false.</p>
  
  <p>Let's approach this a bit different, what is the best way to transform the offset examples above, into seconds? Then I can simply just do <code>$timestamp + $timezone_offset_seconds</code>.</p>