| px | top | add code | search | signup | login | help |
<?php
/********************************************
Convert a MySQL TIMESTAMP to Unix Time
********************************************/
function timestamp2utime($string2format) {
return mktime(substr($string2format, 8,2), substr($string2format, 10, 2), substr($string2format, 12, 2), substr($string2format, 4,2), substr($string2format, 6, 2), substr($string2format, 0, 4));
}
/********************************************
Convert Unix Time to MySQL TIMESTAMP
********************************************/
function utime2timestamp($string2format) {
return date("YmdHis",$string2format);
}
?>
Comments or questions?
PX is running PHP 5.2.11
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.