Dziękuję za pomoc

a oto funkcja:
Kod
// time format: "yyyy-mm-dd hh:mm:ss"
function createDate($year, $mounth, $day, $hour, $minute) {
return date("Y-m-d h:i:s", mktime($hour, $minute, 0, $mounth, $day, $year, 1));
}
nie ma żadnych zabezpieczeń przed niewłaściwymi typami danych - u mnie jest to w innym miejscu.
edit:
A czy jest jakaś funkcja do wyswietlanie czasau Uniksowego jako np. 2 days, 23 h 23min ?
Bo chyba date() tego nie potrafi ? Czy może się mylę.. ?
EDIT 2:
Oraz uzupełnienie kodu:
Kod
// gives an array of int.
/* array ( 0 -> number of weeks
1 -> number of days
2 -> number od days
3 -> hours
4 -> minutes) */
//array mkt2daysHoursMinutes(int $time)
function mkt2daysHoursMinutes($time) {
$result = array();
$weeks = 7*24*60*60;
$days = 24*60*60;
$hours = 60*60;
$minutes= 60;
if (($result[0] = intval($time/$weeks)))
$time %= $weeks;
if (($result[1] = intval($time/$days)))
$time %= $days;
if (($result[2] = intval($time/$hours)))
$time %= $hours;
$result[3] = intval($time/$minutes);
return $result;
}
Działa jak ta lala

edit 3:
Oto link do porady
http://webmade.org/porady/obliczanie-czasu...-datami-php.php