title: Using explode method to extract datetime from database
body: <p>I want to convert a datetime from a database to a timestamp, but it's not working. I changed the <code>split()</code> function (deprecated) to <code>explode()</code> and still got an error: "Undefined offset: 3".</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>function createTimestamp($time) {
  
      list($day, $month, $year, $hour, $minute) = explode(':', $time);  // error is here
      return mktime($hour, $minute, -1, $month, $day, $year) + 1492640000000;
  }
  </code></pre>