DateTime & Comparing dates


Has anyone been working with dates (i know it from php as datetime) and how to compare two dates. Have you seen functions/libs/classes to calculate how many hours are between 20080914 20:24:36 and another datetime string?

If anybody has some code to share i would be happy to have a look! I’ve seen that Poco has a DateTime class. I will look in to it, but reference code is always nice! :slight_smile:


Old thread…
The only date-time lib I know of which works pretty much ‘out of the box’ is cTime.

inside testApp.h

#include <time.h>  

inside testApp.cpp

time_t rawtime;	  
time ( &rawtime );  
printf ( "The current local time is: %s", ctime (&rawtime) );