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?
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?
might be here http://www.php.net/date
gmdate() uses timezones, too
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'];