diff --git a/src/app/Deal.cpp b/src/app/Deal.cpp index 1f49e8a..8c5c7c7 100644 --- a/src/app/Deal.cpp +++ b/src/app/Deal.cpp @@ -108,15 +108,11 @@ namespace Apostol { ch = StrDate.at(++pos); } - if (pos == 10) + if (pos == 10 && Date.Length() == pos) StrDate << " 00:00:00"; - if (StrDate.Length() != 19 && StrDate.Length() != 23) { - return 0; - } - try { - if ((Result = StrToDateTimeDef(StrDate.c_str(), 0, "%04d-%02d-%02d %02d:%02d:%02d")) == 0) + if ((Result = StrToDateTimeDef(StrDate.c_str(), 0)) == 0) return -1; return 1; @@ -130,8 +126,8 @@ namespace Apostol { } //-------------------------------------------------------------------------------------------------------------- - CDateTime StringToDate(const CString &Value, const CString &Format) { - return StrToDateTimeDef(Value.c_str(), 0, Format.c_str()); + CDateTime StringToDate(const CString &Value) { + return StrToDateTimeDef(Value.c_str(), 0); } //-------------------------------------------------------------------------------------------------------------- diff --git a/src/app/Deal.hpp b/src/app/Deal.hpp index 3f529e8..8e808f7 100644 --- a/src/app/Deal.hpp +++ b/src/app/Deal.hpp @@ -43,7 +43,7 @@ namespace Apostol { CString DoubleToBTC(const double &Value, const CString &Format = _T("%f BTC")); //-------------------------------------------------------------------------------------------------------------- - CDateTime StringToDate(const CString &Value, const CString &Format = _T("%04d-%02d-%02d %02d:%02d:%02d")); + CDateTime StringToDate(const CString &Value); CString DateToString(CDateTime Value, const CString &Format = _T("%Y-%m-%d %H:%M:%S")); int VerifyDate(const CString &Date, CDateTime &Result);