A tumblelog CMS built on AJAX, PHP and MySQL.

date.php 281B

123456789101112131415
  1. <?php
  2. $date = "2009-08-06T07:17:19";
  3. preg_match('~(\d+)\d{3}((?:\+|-)\d+)~', $date, $match);
  4. $dt = new DateTime('@' . $match[1]);
  5. $dt = new DateTime($dt->format('Y-m-d H:i:s') . ' ' . $match[2]);
  6. //$date = strtotime($dt->format('r'));
  7. $date = strtotime($date);
  8. echo $date;