X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/69fb3442a8687b783e08972ed0c1f9b6d5e65d54..ac9dc8faf23104c8d82cbf5ff0041f46da8d9534:/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp index 1623988d..42775c7d 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp @@ -15,7 +15,7 @@ */ /* - * Author : Maxim Mamontov + * Author : Maksym Mamontov */ /* @@ -33,6 +33,7 @@ #include +#include "stg/common.h" #include "postgresql_store.h" #include "stg/locker.h" @@ -319,7 +320,7 @@ int32_t id; if (version > 7) query << ", change_policy = '" << TARIFF::ChangePolicyToString(td.tariffConf.changePolicy) << "', \ - change_policy_timeout = CAST('" << Int2TS(td.tariffConf.changePolicyTimeout) << "' AS TIMESTAMP)"; + change_policy_timeout = CAST('" << formatTime(td.tariffConf.changePolicyTimeout) << "' AS TIMESTAMP)"; query << " WHERE pk_tariff = " << id; @@ -516,7 +517,7 @@ if (version > 6) if (version > 7) { td->tariffConf.changePolicy = TARIFF::StringToChangePolicy(PQgetvalue(result, 0, 6)); - td->tariffConf.changePolicyTimeout = TS2Int(PQgetvalue(result, 0, 7)); + td->tariffConf.changePolicyTimeout = readTime(PQgetvalue(result, 0, 7)); } PQclear(result);