I have done some date calculations with mktime and get a return value in seconds. Now how do I convert this back to a valid date ?
I'm confused. You've converted what to seconds, and you want to convert that seconds value into a date?
My Suggestion:
$x = mktime(0,0,$sec, 0,0,0); $y = mktime(0,0,0,0,0,0); //unix epoch time $z = Date($my_date_format, $y-$x);
that should do it.
you may want to make a $z, representing your personal reference time/date (ie:
$z = mktime($hr, $mn, $sc, $dy, $mo, $yr);
and add it to the date statement
$ret = date($my_date_format, $x-$y+$z);
Thanks guys...works great !