mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Consistent date formatting from MySQL
This commit is contained in:
@@ -52,7 +52,7 @@ while($end == 0)
|
||||
{
|
||||
$sql = "WHERE host='".$options['d']."'";
|
||||
}
|
||||
$query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` AS E $sql ORDER BY `datetime` DESC LIMIT 20";
|
||||
$query = "SELECT *,DATE_FORMAT(datetime, '".$config['dateformat']['mysql']['compact']."') as humandate FROM `eventlog` AS E $sql ORDER BY `datetime` DESC LIMIT 20";
|
||||
foreach (dbFetchRows($query, $param) as $entry)
|
||||
{
|
||||
$tbl->addRow(array($entry['datetime'],gethostbyid($entry['host']),$entry['message'],$entry['type'],$entry['reference']));
|
||||
@@ -67,7 +67,7 @@ while($end == 0)
|
||||
{
|
||||
$sql = "WHERE device_id='".$options['d']."'";
|
||||
}
|
||||
$query = "SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog AS S $sql_query ORDER BY `timestamp` DESC LIMIT 20";
|
||||
$query = "SELECT *, DATE_FORMAT(timestamp, '".$config['dateformat']['mysql']['compact']."') AS date from syslog AS S $sql_query ORDER BY `timestamp` DESC LIMIT 20";
|
||||
foreach (dbFetchRows($query, $param) as $entry)
|
||||
{
|
||||
$tbl->addRow(array($entry['timestamp'],gethostbyid($entry['device_id']),$entry['program'],$entry['msg'],$entry['level'],$entry['facility']));
|
||||
|
Reference in New Issue
Block a user