2014-12-18 18:50:47 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*
|
|
|
|
*/
|
2014-08-29 06:15:45 +00:00
|
|
|
|
|
|
|
#include <ctime>
|
|
|
|
|
2014-12-03 23:14:02 +00:00
|
|
|
#include <osquery/tables.h>
|
2014-08-29 06:15:45 +00:00
|
|
|
|
|
|
|
namespace osquery {
|
|
|
|
namespace tables {
|
|
|
|
|
2014-11-26 00:28:10 +00:00
|
|
|
QueryData genTime(QueryContext& context) {
|
2014-08-29 06:15:45 +00:00
|
|
|
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;
|
2015-03-06 00:57:44 +00:00
|
|
|
results.push_back(r);
|
2014-08-29 06:15:45 +00:00
|
|
|
return results;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|