12) { $month = 1; $year++; } } while ($current < $totime); return $result; } function get_form_date($day, $month) { if (preg_match('/^(\d{2}).(\d{2})$/', $month, $matches)) { return mktime(0, 0, 0, $matches[1], $day, $matches[2]); } return 0; } function set_form_date($utime, $prefix) { global $page; $page["form${prefix}day"] = date("d", $utime); $page["form${prefix}month"] = date("m.y", $utime); } function date_to_text($unixtime) { if ($unixtime < 60 * 60 * 24 * 30) return getlocal("time.never"); $then = getdate($unixtime); $now = getdate(); if ($then['yday'] == $now['yday'] && $then['year'] == $now['year']) { $date_format = getlocal("time.today.at"); } else if (($then['yday'] + 1) == $now['yday'] && $then['year'] == $now['year']) { $date_format = getlocal("time.yesterday.at"); } else { $date_format = getlocal("time.dateformat"); } return strftime($date_format . " " . getlocal("time.timeformat"), $unixtime); } ?>