mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
move toEpoch to helpers.cpp, use strptime
Origin commit data
------------------
Branch: ni/coolstream
Commit: 52741fb1e4
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2014-01-04 (Sat, 04 Jan 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -344,6 +344,18 @@ std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/)
|
||||
return result.erase(0, result.find_first_not_of(trimChars));
|
||||
}
|
||||
|
||||
time_t toEpoch(std::string &date)
|
||||
{
|
||||
struct tm t;
|
||||
memset(&t, 0, sizeof(t));
|
||||
char *p = strptime(date.c_str(), "%Y-%m-%d", &t);
|
||||
if(p)
|
||||
return mktime(&t);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
CFileHelpers::CFileHelpers()
|
||||
{
|
||||
FileBufSize = 0xFFFF;
|
||||
|
Reference in New Issue
Block a user