function _optimizedb_date in OptimizeDB 7
Same name and namespace in other branches
- 8 optimizedb.module \_optimizedb_date()
- 6 optimizedb.module \_optimizedb_date()
Output how much time passed from the specified date.
Parameters
int $timestamp: The date in Unix format.
Return value
string The formatted date.
2 calls to _optimizedb_date()
- optimizedb_admin in ./
optimizedb.module - Configuring the module.
- optimizedb_requirements in ./
optimizedb.install - Implements hook_requirements().
File
- ./
optimizedb.module, line 581 - Database Optimization.
Code
function _optimizedb_date($timestamp) {
$timestamp = (int) $timestamp;
if ($timestamp == 0) {
return t('None');
}
$difference = REQUEST_TIME - $timestamp;
$text = format_interval($difference, 1);
return $text;
}