MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / exec

Method exec

source/src/scriptinterpreter.cpp:111–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109{
110 QiFunc_hourtime() : QiFunc(0, 1) {}
111 QiVar exec(const std::vector<QiVar>& args, QiScriptInterpreter*) const override
112 {
113 if (args.empty())
114 {
115 time_t s = time(nullptr);
116 tm m;
117 localtime_s(&m, &s);
118 return QiVar::toString(m.tm_hour) + std::string(":") + QiVar::toString(m.tm_min) + std::string(":") + QiVar::toString(m.tm_sec);
119 }
120 time_t s = args[0].toInteger();
121 return QiVar::toString(s / 3600) + std::string(":") + QiVar::toString((s % 3600) / 60) + std::string(":") + QiVar::toString(s % 60);
122 }
123};
124/*
125int timestamp: sec

Callers

nothing calls this directly

Calls 1

toIntegerMethod · 0.80

Tested by

no test coverage detected