#1

Hi,

How to check if one date is passed another?

2016/08/09 11:00 2016/08/09 11:01

Like if second date is bigger than first then i need to know that, even if 1 sec.
Reply
#2

Dates like 2016/08/09 11:00 are just more readable representations for humans.
A date is in fact just an integer (see Unix Timestamp).
The unix timestamp for the above date is 1470740400.
So what you need to do is compare the integer values of the 2 dates.
Reply
#3

I think you might even get away with using the return value from strcmp. Obviously when they're the same the function returns 0. But if they're not the same the function returns 1 or -1 and using that I believe you should somehow be able to determine which of them is greater.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)