I found a solution for Windows:
istringstream ss_finish("2014-March-02 01:00:00");
ss_finish >> get_time(&t, "%Y-%b-%d %H:%M:%S");
time_t finish = mktime(&t);
But this is not compilable under Linux with gcc because get_time
is not yet implemented (gcc 4.9)
I also found a solution for Linux based on strptime
but this is not compilable under Windows because strptime
is not recognized by the VS compiler.
Is there a cross-platform way to achieve this task?
I could do some #define
s and check for the OS but maybe there are some other functions. And I wouldn't like to use boost
's date-time functions.