@ -1642,6 +1642,7 @@ function api_not_allowed($print_headers = false) {
==============================================================================
*/
/**
* Gets a UNIX timestamp from a MySQL datetime format string
* @param $last_post_datetime standard output date in a sql query
* @return unix timestamp
* @author Toon Van Hoecke < Toon.VanHoecke @ UGent . be >
@ -1655,6 +1656,15 @@ function convert_mysql_date($last_post_datetime) {
$announceDate = mktime($hour, $min, $sec, $month, $day, $year);
return $announceDate;
}
/**
* Gets a MySQL datetime format string from a UNIX timestamp
* @param int UNIX timestamp, as generated by the time() function. Will be generated if parameter not provided
* @return string MySQL datetime format, like '2009-01-30 12:23:34'
*/
function api_get_datetime($time=null) {
if (!isset($time)) { $time = time();}
return date('Y-m-d H:i:s', $time);
}
/**
* Gets item visibility from the item_property table