PX : code

Timestamp <-> Unixti by Lukas Loesche
Download this code


<?php

    
/********************************************
    Convert a MySQL TIMESTAMP to Unix Time
    ********************************************/

    
function timestamp2utime($string2format) {
        return 
mktime(substr($string2format8,2), substr($string2format102), substr($string2format122), substr($string2format4,2), substr($string2format62), substr($string2format04));
    }



    
/********************************************
    Convert Unix Time to MySQL TIMESTAMP
    ********************************************/
    
function utime2timestamp($string2format) {
        return 
date("YmdHis",$string2format);
    }

?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.