【发布时间】:2017-02-17 15:32:18
【问题描述】:
我需要将传入的字符串与来自 DS1307 RTC 模块的日期和时间进行比较。如果到达字符串中的特定时间,我将触发一个事件。
我尝试过使用转换为整数,但它不起作用。
String now_int = rtc.now();
错误提示conversion from DateTime to non-scalar type String is requested
如何比较日期时间和字符串?
【问题讨论】:
-
now()返回一个DateTime对象,而不是字符串或整数。 -
您能否发布您的完整示例,尤其是您打算进行的比较?
标签: c++ datetime time arduino real-time-clock