title: How to get a unix timestamp from DateTime object with PHP 5.2?
body: <p>I'm working on a few years old codebase and it uses DateTime. The server is using <strong>PHP 5.2</strong>.</p>
  
  <p>I see that <strong>DateTime::getTimestamp()</strong> has been added after <strong>PHP 5.3</strong>.</p>
  
  <p>Is it possible to get a timestamp from DateTime in <strong>PHP 5.2</strong>?</p>
  
  <p>I used get_class_methods to see if the method is available, but it's not.</p>
  
  <pre><code>Array
  (
      [0] =&gt; __construct
      [1] =&gt; format
      [2] =&gt; modify
      [3] =&gt; getTimezone
      [4] =&gt; setTimezone
      [5] =&gt; getOffset
      [6] =&gt; setTime
      [7] =&gt; setDate
      [8] =&gt; setISODate
  )
  </code></pre>