MySQL Timestamp to UNIX Timestamp


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.