Date Functions
Date to Timestamp
Datum in Timestamp umwandeln:
/**
* Converts timestamp to date given in format "yyyy-mm-dd hh:mm:ss";
*
* @param string $date Date to convert
* @return timestamp Timestamp
*/
function dateTots($date) {
//$date = "2005-12-31 00:00:00";
$year = substr($date, 0,4);
$month = substr($date, 5, 2);
$day = substr($date, 8, 2);
$hour = substr($date, 11,2);
$min = substr($date, 14, 2);
$sec = substr($date, 17, 2);
return mktime($hour, $min, $sec, $month , $day, $year);
}
Plugins SQL Filter
Meine Plugins haben fast alle ein frei konfigurierbares SQL Filter. Darin kann man z.B. um nur die Datensätze der letzten 7 Tage anzuzeigen eingeben:
tx_rsysproduct_main.tstamp > UNIX_TIMESTAMP() - 60*60*24*7