Hi,

i have use mktime to convert a date to unix time.
How do I convert back to date?
let say i have 1049904000 which is today (april 10 2003)
How do i convert that long int back to date?

    function epochToDate($strDate) {
    	#epochToDate(int date)
    	#converts UNIX timestamp to date
    	#requires xxxxxxxxxx (10)
    	#returns dd/mm/yyyy
    
    if(!$strDate) {
    	Return;
    }
    
    $strDate=date("d/m/y", $strDate);
    Return $strDate;
    }
    

      just use date():

      date("formatting required",Unix timestamp);

        There is a function, gettime( int timestamp ), i think, that returns an array with year, month, date etc..

        $_time = gettime( int timestamp );

        so the year would then be $_time['year'];

          Write a Reply...