MCPcopy Create free account
hub / github.com/YACReader/yacreader / parseDate

Function parseDate

YACReaderLibrary/db/query_parser.cpp:32–39  ·  view source on GitHub ↗

this parses N days to date N days ago for now

Source from the content-addressed store, hash-verified

30
31// this parses N days to date N days ago for now
32std::string parseDate(const std::string &dateString, const std::string &expOperator)
33{
34 // TODO_METADATA add semantics so different formats and meanings are supported,
35 auto now = QDateTime::currentSecsSinceEpoch();
36 auto date = now - stoi(dateString) * 86400;
37
38 return std::to_string(date);
39}
40
41int QueryParser::TreeNode::buildSqlString(std::string &sqlString, int bindPosition) const
42{

Callers 1

bindValuesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected