saving time to db