Compare date and time

Asked

Viewed 146 times

0

In C I have the lib time. h to manipulate date and time, already in Arduino the class Datetime that implements some methods.

I’m not finding, even if it is in the fingernail, how to compare date and time, for example:

if ( dt >= checkin )

where dt is the current date and time and checking a system date, how to compare?

  • that dt and the checkin are of what type ? How they were initialized ?

  • Our sorry forgot, are Datetime so I can use the unixtime() method right?

  • The ideal is to show how variables have been declared and initialized. Include relevant code snippet

1 answer

0

You can convert the two dates to a number format with the function mktime and compare them.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.