Commit 1489e80a authored by Fang-WANG's avatar Fang-WANG

add time in json

parent a5d8fcac
...@@ -1311,6 +1311,13 @@ bool smf_app::handle_nf_status_notification( ...@@ -1311,6 +1311,13 @@ bool smf_app::handle_nf_status_notification(
for (auto address : nfIpv4Addresses) { for (auto address : nfIpv4Addresses) {
json_data["ipv4Addresses"].push_back(inet_ntoa(address)); json_data["ipv4Addresses"].push_back(inet_ntoa(address));
} }
time_t rawtime;
struct tm *info;
char buffer[80];
time( &rawtime );
info = localtime( &rawtime );
strftime(buffer, 80, "%Y-%m-%d %H:%M:%S", info);
json_data["time"] = buffer;
my_json json_data_arr = nlohmann::json::array(); my_json json_data_arr = nlohmann::json::array();
json_data_arr.push_back(json_data); json_data_arr.push_back(json_data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment