libext: add function extract_time
libdb: import time to db