Skip to content

Commit

Permalink
msi_dir_list: return modified time as seconds-since-epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed May 7, 2024
1 parent e163e55 commit 57c491f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/msi_dir_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,8 @@ int msiDirList(msParam_t* _path, msParam_t* _rescName, msParam_t* _list, ruleExe
}

std::time_t modifiedTime = fs::last_write_time(entry.path());
char* localModifiedTime = std::asctime(std::localtime(&modifiedTime));

// Remove trailing newline.
localModifiedTime[strcspn(localModifiedTime, "\n")] = '\0';
std::string modifiedTimestamp(localModifiedTime);

entryJson.put("modified_timestamp", modifiedTimestamp);
entryJson.put("modified_timestamp", modifiedTime);
jsonResult.push_back(std::make_pair(entry.path().string(), entryJson));
}

Expand Down

0 comments on commit 57c491f

Please sign in to comment.