The problem is that tm_year is the year since 1900, so 2013 would be 113 http://en.cppreference.com/w/cpp/chrono/c/tm
start_date.tm_hour = 0; start_date.tm_min = 0; start_date.tm_sec = 0;
start_date.tm_mon = 10; start_date.tm_mday = 15; start_date.tm_year = 113;
end_date.tm_hour = 0; end_date.tm_min = 0; end_date.tm_sec = 0;
end_date.tm_mon = 10; end_date.tm_mday = 20; end_date.tm_year = 113;
Given 2013, mktime will return -1 as the calendar time cannot be represented. You would think that the year 3913 would be a valid calendar time and the reason is related to the year 2038 problem, as pointed out by Joni