I Think this is working now for writing to the DB with correct time.