2014-08-29 06:15:45 +00:00
|
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
|
|
|
|
#include <ctime>
|
|
|
|
|
2014-11-25 20:30:29 +00:00
|
|
|
#include "osquery/tables.h"
|
2014-08-29 06:15:45 +00:00
|
|
|
|
|
|
|
namespace osquery {
|
|
|
|
namespace tables {
|
|
|
|
|
|
|
|
const int kNumCols = 1;
|
|
|
|
|
|
|
|
QueryData genTime() {
|
|
|
|
Row r;
|
|
|
|
time_t _time = time(0);
|
|
|
|
struct tm* now = localtime(&_time);
|
2014-11-17 18:30:46 +00:00
|
|
|
r["hour"] = INTEGER(now->tm_hour);
|
|
|
|
r["minutes"] = INTEGER(now->tm_min);
|
|
|
|
r["seconds"] = INTEGER(now->tm_sec);
|
2014-08-29 06:15:45 +00:00
|
|
|
QueryData results;
|
|
|
|
for (int i = 0; i < kNumCols; ++i) {
|
|
|
|
results.push_back(r);
|
|
|
|
}
|
|
|
|
return results;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|