Restored to_time_t() function

Restored to_time_t() function removed by commit 6636f49f13154555b3b9c9618fca5f03cf47a5b3.