There's a ternary operator used in the time_to_epoch function that sets tdays to 0 if the value in tm_mon of the time struct is 0. 0 happens to be used for January. Thus, if you try to convert a string of a date in January to an epoch timestamp, the resulting time_t value will be invalid. This tm_mon check should be removed and any parts of the codebase that rely on 0 implying "not set" instead of January should be fixed.
I hope to get some time to add a unit test for this scenario.
Nice find Evan. Thanks