string conversion utility in rtc driver
This commit is contained in:
@@ -185,6 +185,12 @@ namespace drivers
|
||||
return buf.substr(0, std::min(buf.find('\n'),buf.find('\r')));
|
||||
}
|
||||
|
||||
const std::string PCF85063::tm2str(const std::tm &datetime)
|
||||
{
|
||||
const std::string buf(std::asctime(&datetime));
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user