From 1a52bd058120e511f8b64c7651938c424d60c86b Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sat, 26 May 2007 10:13:59 +0000 Subject: - manage lazy input for time: e.g. "21" -> "21:00" --- tools.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools.cpp') diff --git a/tools.cpp b/tools.cpp index a75068f..8dca6df 100644 --- a/tools.cpp +++ b/tools.cpp @@ -150,6 +150,8 @@ std::string MD5Hash(std::string const& str) time_t GetTimeT(std::string timestring) // timestring in HH:MM { timestring = StringReplace(timestring, ":", ""); + if (timestring.size() < 4) + timestring += string(4 - timestring.size(), '0'); int iTime = lexical_cast< int >( timestring ); struct tm tm_r; time_t t = time(NULL); -- cgit v1.2.3