Save time in the database