Posted By

flipace on 10/13/11


Tagged

phpmysqltimestampunixconversionconvert


Versions (?)

MySQL Timestamp to UNIX Timestamp


 / Published in: PHP
 

  1. $s = $a['sql_timestamp'];
  2. $s1 = explode("-",$s);
  3. $s2 = explode(" ",$s1[2]);
  4. $s3 = explode(":",$s2[1]);
  5. $unix_timestamp = mktime($s3[0],$s3[1], $s3[2], $s1[1], $s2[0], $s1[0]);

Report this snippet  

You need to login to post a comment.