Add a to_time_t function that returns a time_t from ptime.