first version of cron, does not read configuation from file
This commit is contained in:
@@ -180,6 +180,12 @@ namespace drivers
|
||||
|
||||
const std::string PCF85063::datetime2str(const datetime_t &datetime)
|
||||
{
|
||||
tm dtime = datetime2tm(datetime);
|
||||
const std::string buf(std::asctime(&dtime));
|
||||
return buf.substr(0, std::min(buf.find('\n'),buf.find('\r')));
|
||||
}
|
||||
|
||||
const std::tm PCF85063::datetime2tm(const datetime_t& datetime) {
|
||||
tm dtime;
|
||||
dtime.tm_sec = datetime.second;
|
||||
dtime.tm_min = datetime.minute;
|
||||
@@ -188,8 +194,7 @@ namespace drivers
|
||||
dtime.tm_mday = datetime.day;
|
||||
dtime.tm_mon = datetime.month - 1;
|
||||
dtime.tm_year = datetime.year - 1900; // time offset in structure according cpp reference
|
||||
const std::string buf(std::asctime(&dtime));
|
||||
return buf.substr(0, std::min(buf.find('\n'),buf.find('\r')));
|
||||
return dtime;
|
||||
}
|
||||
|
||||
const uint8_t PCF85063::decToBcd(const int val)
|
||||
|
||||
Reference in New Issue
Block a user